修复地图闪烁问题

This commit is contained in:
2026-06-04 17:56:43 +08:00
parent 6fb6fc4f10
commit 60b19ab8ca
+6
View File
@@ -112,6 +112,10 @@ function mergeMessages(existing: TextMessage[], incoming: TextMessage[]): TextMe
return Array.from(byId.values()).sort(compareMessages)
}
function isSameJSON(left: unknown, right: unknown): boolean {
return JSON.stringify(left) === JSON.stringify(right)
}
async function loadInitialChatMessages() {
const response = await getTextMessages(chatPageSize, 0)
messages.value = toChronological(response.items)
@@ -170,7 +174,9 @@ async function loadMapReportsForBounds(bounds: MapBoundsQuery, zoom: number, sho
if (requestSeq !== mapReportRequestSeq) {
return
}
if (!isSameJSON(mapViewportItems.value, response.items)) {
mapViewportItems.value = response.items
}
mapViewportMode.value = response.mode
mapReportTotal.value = response.total
} catch (err) {