fix: 가오픈 설문 알림의 중복 갱신 유지
동일한 front status가 연속 도착해도 방금 열린 설문 알림을 즉시 닫지 않도록 cursor 처리를 멱등하게 만든다. production Chromium 회귀로 실시간 재조회 뒤 알림 유지를 검증한다.
This commit is contained in:
@@ -306,7 +306,13 @@ export const useMainDashboardStore = defineStore('mainDashboard', () => {
|
||||
const storageKey = `state.${serverId}.lastVote`;
|
||||
const lastSeenVoteId = Number.parseInt(window.localStorage.getItem(storageKey) ?? '0', 10);
|
||||
if (latestVote.id <= (Number.isFinite(lastSeenVoteId) ? lastSeenVoteId : 0)) {
|
||||
surveyNotice.value = null;
|
||||
// Initial mounting, general creation and realtime invalidation can fetch
|
||||
// the same front status in quick succession. The first response records
|
||||
// the cursor; a duplicate response must not immediately dismiss the
|
||||
// notice that response just opened.
|
||||
if (surveyNotice.value?.id !== latestVote.id) {
|
||||
surveyNotice.value = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
window.localStorage.setItem(storageKey, latestVote.id.toString());
|
||||
|
||||
Reference in New Issue
Block a user