diff --git a/README.md b/README.md index 76d928b6380..33f6e85cbb0 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Your openai api key. ### `CODE` (optional) -Access passsword, separated by comma. +Access password, separated by comma. ### `BASE_URL` (optional) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 8ed6b77383c..795469a9681 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -753,7 +753,7 @@ export function Settings() { title={`${config.fontSize ?? 14}px`} value={config.fontSize} min="12" - max="18" + max="40" step="1" onChange={(e) => updateConfig( diff --git a/public/serviceWorker.js b/public/serviceWorker.js index f5a24b70176..2e1d60b98d2 100644 --- a/public/serviceWorker.js +++ b/public/serviceWorker.js @@ -1,15 +1,21 @@ const CHATGPT_NEXT_WEB_CACHE = "chatgpt-next-web-cache"; +importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js'); + self.addEventListener("activate", function (event) { console.log("ServiceWorker activated."); }); -self.addEventListener("install", function (event) { - event.waitUntil( - caches.open(CHATGPT_NEXT_WEB_CACHE).then(function (cache) { - return cache.addAll([]); - }), - ); +workbox.core.clientsClaim(); +self.addEventListener("message", (event) => { + if (event.data && event.data.type === "SKIP_WAITING") { + self.skipWaiting(); + } }); -self.addEventListener("fetch", (e) => {}); +workbox.routing.registerRoute( + new RegExp('/*'), + new workbox.strategies.StaleWhileRevalidate({ + cacheName: CHATGPT_NEXT_WEB_CACHE + }) +);