mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-14 19:25:02 -05:00
21 lines
559 B
TypeScript
21 lines
559 B
TypeScript
import { registerSW } from "virtual:pwa-register";
|
|
|
|
import "./styles/index.scss";
|
|
import { render } from "preact";
|
|
|
|
import { internalEmit } from "./lib/eventEmitter";
|
|
|
|
import { App } from "./pages/app";
|
|
|
|
export const updateSW = registerSW({
|
|
onNeedRefresh() {
|
|
internalEmit("PWA", "update");
|
|
},
|
|
onOfflineReady() {
|
|
console.info("Ready to work offline.");
|
|
// show a ready to work offline to user
|
|
},
|
|
});
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
render(<App />, document.getElementById("app")!);
|