Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto 2023-10-17 12:55:04 +08:00
commit f8b3d014d7
2 changed files with 14 additions and 8 deletions

View File

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

View File

@ -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
})
);