Merge branch 'Yidadaa:main' into exporter

This commit is contained in:
H0llyW00dzZ 2023-10-23 10:19:26 +07:00 committed by GitHub
commit 532e647d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 9 deletions

View File

@ -159,7 +159,7 @@ Your openai api key.
### `CODE` (optional) ### `CODE` (optional)
Access passsword, separated by comma. Access password, separated by comma.
### `BASE_URL` (optional) ### `BASE_URL` (optional)
@ -313,6 +313,7 @@ If you want to add a new translation, read this [document](./docs/translation.md
[@AnsonHyq](https://github.com/AnsonHyq) [@AnsonHyq](https://github.com/AnsonHyq)
[@synwith](https://github.com/synwith) [@synwith](https://github.com/synwith)
[@piksonGit](https://github.com/piksonGit) [@piksonGit](https://github.com/piksonGit)
[@ouyangzhiping](https://github.com/ouyangzhiping)
### Contributor ### Contributor

View File

@ -753,7 +753,7 @@ export function Settings() {
title={`${config.fontSize ?? 14}px`} title={`${config.fontSize ?? 14}px`}
value={config.fontSize} value={config.fontSize}
min="12" min="12"
max="18" max="40"
step="1" step="1"
onChange={(e) => onChange={(e) =>
updateConfig( updateConfig(

View File

@ -1,15 +1,21 @@
const CHATGPT_NEXT_WEB_CACHE = "chatgpt-next-web-cache"; 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) { self.addEventListener("activate", function (event) {
console.log("ServiceWorker activated."); console.log("ServiceWorker activated.");
}); });
self.addEventListener("install", function (event) { workbox.core.clientsClaim();
event.waitUntil( self.addEventListener("message", (event) => {
caches.open(CHATGPT_NEXT_WEB_CACHE).then(function (cache) { if (event.data && event.data.type === "SKIP_WAITING") {
return cache.addAll([]); self.skipWaiting();
}), }
);
}); });
self.addEventListener("fetch", (e) => {}); workbox.routing.registerRoute(
new RegExp('/*'),
new workbox.strategies.StaleWhileRevalidate({
cacheName: CHATGPT_NEXT_WEB_CACHE
})
);