Skip to content

Commit c6cdc79

Browse files
committed
chore: version bump
1 parent b658b96 commit c6cdc79

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/common/hooks/useVersionUpdate/useVersionUpdateReload.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const useVersionUpdateReload = ({ toastEligibleRoutes }: VersionUpdatePro
127127

128128
const handleAppUpdate = () => {
129129
dismissToast({ updateToastRef })
130-
130+
refreshing.current = true
131131
// eslint-disable-next-line @typescript-eslint/no-floating-promises
132132
updateServiceWorker(true)
133133
}
@@ -149,7 +149,6 @@ export const useVersionUpdateReload = ({ toastEligibleRoutes }: VersionUpdatePro
149149
if (!bgUpdated) {
150150
return
151151
}
152-
dismissToast({ updateToastRef })
153152
if (toastEligibleRoutesMap[location.pathname]) {
154153
updateToastRef.current = ToastManager.showToast(
155154
{
@@ -170,7 +169,7 @@ export const useVersionUpdateReload = ({ toastEligibleRoutes }: VersionUpdatePro
170169
},
171170
)
172171
}
173-
}, [bgUpdated, location])
172+
}, [bgUpdated])
174173

175174
// Sync local state with the service worker's needRefresh state
176175
useEffect(() => {
@@ -198,9 +197,7 @@ export const useVersionUpdateReload = ({ toastEligibleRoutes }: VersionUpdatePro
198197
.getRegistrations()
199198
.then((registrations) => registrations.forEach((reg) => reg.update()))
200199
if (doesNeedRefresh && !refreshing.current) {
201-
handleNeedRefresh(updateServiceWorker)
202-
} else if (bgUpdated) {
203-
dismissToast({ updateToastRef })
200+
handleAppUpdate()
204201
}
205202
}
206203
}, [location])

0 commit comments

Comments
 (0)