Skip to content

Commit

Permalink
Clear site data when needed (#1029)
Browse files Browse the repository at this point in the history
* fixes event histories

* Clear site data when needed

Co-authored-by: Victor Creed <rytis.grincevicius+cv@gmail.com>
Co-authored-by: Victor Creed <69458664+creed-victor@users.noreply.github.com>
  • Loading branch information
3 people committed May 6, 2021
1 parent 664dfbf commit a32047c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/components/ServiceWorkerToaster/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export function ServiceWorkerToaster(props: Props) {
onClick: () => {
waitingWorker &&
waitingWorker.postMessage({ type: 'SKIP_WAITING' });
window.location.replace(window.location.href);

fetch(`/clear-site-data`).finally(() =>
window.location.replace(window.location.href),
);
},
text: t(translations.serviceWorkerToaster.button),
},
Expand Down
5 changes: 4 additions & 1 deletion src/utils/loadable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export const lazyLoad = <
alert(
"dApp failed to load, let's try again.\nIt may be an issue with an internet connection.",
);
window.location.replace(window.location.href);

fetch(`/clear-site-data`).finally(() =>
window.location.replace(window.location.href),
);
}
return reason;
});
Expand Down

0 comments on commit a32047c

Please sign in to comment.