general: fixes

This commit is contained in:
k
2024-09-19 21:03:50 +02:00
parent d2349741f7
commit 412769ff03
11 changed files with 40 additions and 21 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -1308,7 +1308,7 @@
localStorage.getItem(settingsThemeLocalStorageKey)
);
const preferredColorSchemeMatchMedia = window.matchMedia(
"(prefers-color-scheme: dark)",
"(prefers-color-scheme: dark)"
);
if (
theme === "dark" ||
@@ -1320,7 +1320,7 @@
}
const backgroundColor = getComputedStyle(
window.document.documentElement,
window.document.documentElement
).getPropertyValue("--background-color");
const meta = window.document.createElement("meta");
meta.name = "theme-color";
@@ -1676,7 +1676,7 @@
<a
id="anchor-git"
title="Git"
href="https://github.com/kibo-money"
href="https://github.com/kibo-money/kibo"
target="_blank"
rel="noopener noreferrer"
>
@@ -2015,7 +2015,7 @@
rel="noopener noreferrer"
target="_blank"
>
0.4.0
0.4.1
</a>
</p>
</footer>
+6 -4
View File
@@ -8431,6 +8431,7 @@ lazySignals.then((importedSignals) => {
const head = history.at(0);
if (
head &&
head.preset === preset &&
dateToTestedString(new Date()) === dateToTestedString(head.date)
) {
return;
@@ -8452,10 +8453,11 @@ lazySignals.then((importedSignals) => {
serializedHistory.length = MAX_HISTORY_LENGTH;
}
localStorage.setItem(
LOCAL_STORAGE_HISTORY_KEY,
JSON.stringify(serializedHistory)
);
const jsonHistory = JSON.stringify(serializedHistory);
console.log(jsonHistory);
localStorage.setItem(LOCAL_STORAGE_HISTORY_KEY, jsonHistory);
});
});
}
+6 -2
View File
@@ -50,18 +50,22 @@ self.addEventListener("fetch", (_event) => {
const request = event.request;
const { url, method } = request;
console.log(`service-worker: fetching: ${url}`);
event.respondWith(
caches.match(request).then((cachedResponse) => {
return fetch(request)
.then((response) => {
const { status } = response;
// @ts-ignore
if (url.includes("/api/")) {
return response;
}
return caches.open(version).then((cache) => {
if (response.status === 200) {
if (method === "GET") {
if (status === 200 || status === 304) {
if (status === 200 && method === "GET") {
cache.put(request, response.clone());
}
return response;
+3 -3
View File
File diff suppressed because one or more lines are too long