Skip to content

Commit 47751e6

Browse files
committed
added setTimeout to reload
1 parent b57715d commit 47751e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/App.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ export default function App() {
190190
function update() {
191191
updateServiceWorker(true)
192192
// Trigger page reload
193-
//window.location.reload()
193+
window.location.reload()
194+
setTimeout(() => {}, 500)
194195
}
195196

196197
function onUpdate() {
@@ -214,6 +215,10 @@ export default function App() {
214215
useEffect(() => {
215216
if (needRefresh) {
216217
update()
218+
} else {
219+
if (toast.isActive(updateToastRef.current)) {
220+
toast.dismiss(updateToastRef.current)
221+
}
217222
}
218223
}, [location])
219224

0 commit comments

Comments
 (0)