mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-30 01:09:26 -07:00
general: fixes
This commit is contained in:
13
CHANGELOG.md
13
CHANGELOG.md
@@ -4,6 +4,19 @@
|
||||
|
||||

|
||||
|
||||
## v. 0.4.1 | WIP
|
||||
|
||||

|
||||
|
||||
## Website
|
||||
|
||||
- Fixed service worker not passing 304 (not modified) response and instead serving cached responses
|
||||
- Fixed history not being properly registered
|
||||
|
||||
## Server
|
||||
|
||||
- Fixed links in several places missing the `/api` part and thus not working
|
||||
|
||||
## v. 0.4.0 | [861950](https://mempool.space/block/00000000000000000000530d0e30ccf7deeace122dcc99f2668a06c6dad83629) - 2024/09/19
|
||||
|
||||

|
||||
|
||||
2
parser/Cargo.lock
generated
2
parser/Cargo.lock
generated
@@ -1280,7 +1280,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parser"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"allocative",
|
||||
"bincode",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "parser"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
4
server/Cargo.lock
generated
4
server/Cargo.lock
generated
@@ -1814,7 +1814,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parser"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"allocative",
|
||||
"bincode",
|
||||
@@ -2478,7 +2478,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "server"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"bincode",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "server"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -180,7 +180,7 @@ where
|
||||
datasets.get(&ChunkId::from_usize(offseted)).map(|_| {
|
||||
let scheme = headers.get_scheme();
|
||||
let host = headers.get_host();
|
||||
format!("{scheme}://{host}/{}?chunk={offseted}", route.url_path)
|
||||
format!("{scheme}://{host}/api/{}?chunk={offseted}", route.url_path)
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ impl Routes {
|
||||
.map(|(key, route)| {
|
||||
(
|
||||
key.to_owned(),
|
||||
format!("{url}/{}", route.url_path.to_owned()),
|
||||
format!("{url}/api/{}", route.url_path.to_owned()),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
6
website/types/paths.d.ts
vendored
6
website/types/paths.d.ts
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user