+ This app has just been updated!
+
+ Restart it to enjoy the new features.
+
+
+
+ );
+};
diff --git a/src/utils/helpers/sw.ts b/src/utils/helpers/sw.ts
new file mode 100644
index 00000000..a318047b
--- /dev/null
+++ b/src/utils/helpers/sw.ts
@@ -0,0 +1,16 @@
+export const forceUpdate = async () => {
+ const registrations = await navigator.serviceWorker?.getRegistrations() ?? [];
+
+ for (const registration of registrations) {
+ const { waiting } = registration;
+
+ waiting?.addEventListener('statechange', (event) => {
+ if ((event.target as any)?.state === 'activated') {
+ window.location.reload();
+ }
+ });
+
+ // The logic that makes skipWaiting to be called when this message is posted is in service-worker.ts
+ waiting?.postMessage({ type: 'SKIP_WAITING' });
+ }
+};
diff --git a/test/App.test.tsx b/test/App.test.tsx
index 1607a7b4..2ce9c408 100644
--- a/test/App.test.tsx
+++ b/test/App.test.tsx
@@ -1,9 +1,9 @@
import { shallow, ShallowWrapper } from 'enzyme';
import { Route } from 'react-router-dom';
import { Mock } from 'ts-mockery';
-import { Alert } from 'reactstrap';
import { Settings } from '../src/settings/reducers/settings';
import appFactory from '../src/App';
+import { AppUpdateBanner } from '../src/common/AppUpdateBanner';
describe('