diff --git a/src/features/workbench/map-workbench-page.tsx b/src/features/workbench/map-workbench-page.tsx index c65859f..04fa4fb 100644 --- a/src/features/workbench/map-workbench-page.tsx +++ b/src/features/workbench/map-workbench-page.tsx @@ -26,6 +26,7 @@ import { MapSourceStatusNotice, MapToolbar, MapZoom, + dismissMapNotice, showMapNotice, type MapToolbarItem, type MapSourceStatus @@ -166,6 +167,25 @@ export function MapWorkbenchPage({ ScheduledConditionRecord[] >([]); const workbenchSync = useWorkbenchSync(getAccessToken); + const workbenchSyncReconnecting = + workbenchSync.status === "reconnecting" && workbenchSync.snapshot !== null; + useEffect(() => { + const noticeId = "workbench-sync-reconnecting"; + if (!workbenchSyncReconnecting) { + dismissMapNotice(noticeId); + return; + } + + showMapNotice({ + id: noticeId, + tone: "warning", + title: "业务同步正在重连", + message: "当前数据可能陈旧,连接恢复后将自动更新。", + duration: Infinity + }); + + return () => dismissMapNotice(noticeId); + }, [workbenchSyncReconnecting]); const { headerDataTime, scheduledConditions: runtimeScheduledConditions, @@ -1166,15 +1186,6 @@ export function MapWorkbenchPage({ onLogout={onLogout} /> - {workbenchSync.status === "reconnecting" && workbenchSync.snapshot ? ( -