bringing back the service worker

This commit is contained in:
Amruth Pillai
2020-10-10 12:45:04 +05:30
parent 6bc0451ed9
commit 36aad98485
4 changed files with 315 additions and 7 deletions

View File

@ -27,6 +27,17 @@ const theme = createMuiTheme({
},
});
export const onServiceWorkerUpdateReady = () => {
// eslint-disable-next-line no-alert
const answer = window.confirm(
`This application has been updated. ` +
`Reload to display the latest version?`,
);
if (answer === true) {
window.location.reload();
}
};
// eslint-disable-next-line import/prefer-default-export
export const wrapRootElement = ({ element }) => (
<SettingsProvider>