rename: client -> frontend
This commit is contained in:
13
packages/frontend/src/scripts/initialize-sw.ts
Normal file
13
packages/frontend/src/scripts/initialize-sw.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { lang } from '@/config';
|
||||
|
||||
export async function initializeSw() {
|
||||
if (!('serviceWorker' in navigator)) return;
|
||||
|
||||
navigator.serviceWorker.register(`/sw.js`, { scope: '/', type: 'classic' });
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.active?.postMessage({
|
||||
msg: 'initialize',
|
||||
lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user