feat(web): pwa offline caching, dockerized SPA, full-stack nginx smoke
This commit is contained in:
@@ -47,6 +47,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
setToken(null);
|
||||
setTok(null);
|
||||
qc.clear();
|
||||
if (typeof caches !== "undefined") {
|
||||
void caches.delete("booklib-api");
|
||||
void caches.delete("booklib-immutable");
|
||||
}
|
||||
},
|
||||
}),
|
||||
[meQ.data, meQ.isPending, meQ.isError, token, qc],
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createRoot } from "react-dom/client";
|
||||
import App from "./App";
|
||||
import { queryClient } from "./lib/qc";
|
||||
import "./index.css";
|
||||
import "./pwa";
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { registerSW } from "virtual:pwa-register";
|
||||
|
||||
// autoUpdate:新版本静默装好即用;个人应用无需升级确认弹窗
|
||||
registerSW({ immediate: true });
|
||||
Reference in New Issue
Block a user