Updated to airbnb coding styles

This commit is contained in:
Alejandro Celaya
2022-03-26 12:17:42 +01:00
parent 4e9b19afd1
commit a2df486280
239 changed files with 2210 additions and 3549 deletions

View File

@@ -1,9 +1,7 @@
export const forceUpdate = async () => {
const registrations = await navigator.serviceWorker?.getRegistrations() ?? [];
for (const registration of registrations) {
const { waiting } = registration;
registrations.forEach(({ waiting }) => {
waiting?.addEventListener('statechange', (event) => {
if ((event.target as any)?.state === 'activated') {
window.location.reload();
@@ -12,5 +10,5 @@ export const forceUpdate = async () => {
// The logic that makes skipWaiting to be called when this message is posted is in service-worker.ts
waiting?.postMessage({ type: 'SKIP_WAITING' });
}
});
};