fix: token speed disappear on complete
This commit is contained in:
parent
b81b008a93
commit
5b9c1fc668
@ -264,6 +264,9 @@ export default function ModelHandler() {
|
||||
if (updatedMessage) {
|
||||
deleteMessage(message.id)
|
||||
addNewMessage(updatedMessage)
|
||||
setTokenSpeed((prev) =>
|
||||
prev ? { ...prev, message: updatedMessage.id } : undefined
|
||||
)
|
||||
}
|
||||
})()
|
||||
|
||||
|
||||
@ -4,11 +4,7 @@ import { isToday } from './datetime'
|
||||
test("should return only time for today's timestamp", () => {
|
||||
const today = new Date()
|
||||
const timestamp = today.getTime()
|
||||
const expectedTime = `${today.toLocaleDateString(undefined, {
|
||||
day: '2-digit',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
})}, ${today.toLocaleTimeString(undefined, {
|
||||
const expectedTime = `${today.toLocaleTimeString(undefined, {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
@ -24,5 +20,5 @@ test('should return N/A for undefined timestamp', () => {
|
||||
test("should return true for today's timestamp", () => {
|
||||
const today = new Date()
|
||||
const timestamp = today.setHours(0, 0, 0, 0)
|
||||
expect(isToday(timestamp)).toBe(true)
|
||||
expect(isToday(timestamp / 1000)).toBe(true)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user