Skip to content

Commit 774b455

Browse files
committed
Fix timeRange calculation to use current time instead of stale lastTime
1 parent 69457e4 commit 774b455

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/stores/chatMessages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ export const useChatMessagesStore = defineStore('chatMessages', () => {
228228
beforeDate.getMonth(),
229229
beforeDate.getDate()
230230
)
231-
const endOfDay = timeRange
232-
timeRange = formatCSTRange(startOfDay, new Date(endOfDay))
231+
// 从 lastTime 所在天的 0 点到当前时间,避免 session.lastTime 过时导致漏掉新消息
232+
timeRange = formatCSTRange(startOfDay, new Date())
233233
}
234234
try {
235235
loading.value = true

0 commit comments

Comments
 (0)