rename: client -> frontend
This commit is contained in:
parent
db6fff6f26
commit
9384f5399d
592 changed files with 111 additions and 111 deletions
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,
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue