Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 17, 2023
2 parents 1d16441 + cc565cf commit 6e9052e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Your openai api key.

### `CODE` (optional)

Access passsword, separated by comma.
Access password, separated by comma.

### `BASE_URL` (optional)

Expand Down
2 changes: 1 addition & 1 deletion app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
20 changes: 13 additions & 7 deletions public/serviceWorker.js
Original file line number Diff line number Diff line change
@@ -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
})
);

0 comments on commit 6e9052e

Please sign in to comment.