- Add LICENSE file (CC BY-NC-SA 4.0) - Add .nvmrc pinning Node 22 - Add Renovate config with daily schedule and Gitea Actions workflow - Reduce ESLint max-warnings from 1000 to 50 - Re-enable Biome a11y/security recommended rules - Fix Biome lint issues (a11y, hook deps, SVG labels, checkbox semantics) - Improve CI: run on pushes to feat/fix branches, add pnpm audit - Add Vitest coverage with v8 provider and thresholds - Add E2E tests (auth, admin, navigation specs) - Add admin-maintenance server action test - Install @vitest/coverage-v8 - Ignore coverage/ directory
22 lines
440 B
TypeScript
22 lines
440 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
const SW_VERSION = "3";
|
|
|
|
export function PwaRegister() {
|
|
useEffect(() => {
|
|
if (typeof navigator === "undefined" || !("serviceWorker" in navigator))
|
|
return;
|
|
|
|
navigator.serviceWorker.getRegistrations().then((regs) => {
|
|
for (const reg of regs) {
|
|
reg.unregister();
|
|
}
|
|
});
|
|
|
|
navigator.serviceWorker.register(`/sw.js?${SW_VERSION}`).catch(() => {});
|
|
}, []);
|
|
return null;
|
|
}
|