修复聊天消息不显示最新数据:所有列表查询排序从 created_at DESC 改为 id DESC,记录创建函数显式设置 CreatedAt,后端 v1.2.1 / 前端 v0.3.1
This commit is contained in:
@@ -257,8 +257,7 @@ function toChronological(items: TextMessage[]): TextMessage[] {
|
||||
}
|
||||
|
||||
function compareMessages(a: TextMessage, b: TextMessage): number {
|
||||
const timeDiff = Date.parse(a.created_at) - Date.parse(b.created_at)
|
||||
return timeDiff !== 0 ? timeDiff : a.id - b.id
|
||||
return a.id - b.id
|
||||
}
|
||||
|
||||
function mergeMessages(existing: TextMessage[], incoming: TextMessage[]): TextMessage[] {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const FRONTEND_VERSION = '0.3.0'
|
||||
export const FRONTEND_VERSION = '0.3.1'
|
||||
Reference in New Issue
Block a user