mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-31 12:43:06 -07:00
global: snapshot
This commit is contained in:
@@ -1153,6 +1153,7 @@
|
||||
window.document.documentElement.dataset.display = "standalone";
|
||||
}
|
||||
|
||||
console.log(navigator);
|
||||
if ("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.register("/scripts/service-worker.js");
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
||||
elements,
|
||||
options: _options = {},
|
||||
}) {
|
||||
console.log(elements.style.fontFamily);
|
||||
/** @satisfies {DeepPartial<ChartOptions>} */
|
||||
const options = {
|
||||
autoSize: true,
|
||||
@@ -199,7 +198,6 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
||||
*/
|
||||
function createSetFetchedDataEffect(series, valuesResource) {
|
||||
const fetchedKey = vecsResources.defaultFetchedKey;
|
||||
console.log(fetchedKey);
|
||||
|
||||
signals.runWithOwner(owner, () =>
|
||||
signals.createEffect(
|
||||
|
||||
@@ -23,8 +23,6 @@ export function init({
|
||||
vecsResources,
|
||||
vecIdToIndexes,
|
||||
}) {
|
||||
console.log("init chart state");
|
||||
|
||||
elements.charts.append(utils.dom.createShadow("left"));
|
||||
elements.charts.append(utils.dom.createShadow("right"));
|
||||
|
||||
@@ -223,7 +221,7 @@ export function init({
|
||||
{ blueprints: option.bottom, paneIndex: 1 },
|
||||
].forEach(({ blueprints, paneIndex }) => {
|
||||
const unit = paneIndex ? bottomUnit : topUnit;
|
||||
console.log({ unit });
|
||||
|
||||
blueprints[unit]?.forEach((blueprint) => {
|
||||
const indexes = /** @type {readonly number[]} */ (
|
||||
vecIdToIndexes[blueprint.key]
|
||||
|
||||
@@ -729,17 +729,13 @@ function createUtils() {
|
||||
id === "close" ||
|
||||
id === "open" ||
|
||||
id === "marketcap" ||
|
||||
id.includes("in-usd") ||
|
||||
id.startsWith("price") ||
|
||||
id.endsWith("price") ||
|
||||
id.endsWith("value-created") ||
|
||||
id.endsWith("value-destroyed") ||
|
||||
id.endsWith("realized-cap") ||
|
||||
id.endsWith("realized-loss") ||
|
||||
id.endsWith("realized-loss-sum") ||
|
||||
id.endsWith("realized-profit") ||
|
||||
id.endsWith("realized-profit-sum") ||
|
||||
id.includes("in-usd") ||
|
||||
(!id.includes("ratio") && id.endsWith("sma")) ||
|
||||
(id.includes("realized") && !id.includes("ratio")) ||
|
||||
(id.endsWith("sma") && !id.includes("ratio")) ||
|
||||
id.endsWith("ath"))
|
||||
) {
|
||||
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
||||
@@ -752,11 +748,7 @@ function createUtils() {
|
||||
if (
|
||||
(!unit || thoroughUnitCheck) &&
|
||||
(id.endsWith("ratio") ||
|
||||
(id.includes("ratio") &&
|
||||
(id.endsWith("-sma") ||
|
||||
id.endsWith("-1w-sma") ||
|
||||
id.endsWith("-1m-sma") ||
|
||||
id.endsWith("-1y-sma"))) ||
|
||||
(id.includes("ratio") && id.endsWith("sma")) ||
|
||||
id.endsWith("1sd") ||
|
||||
id.endsWith("2sd") ||
|
||||
id.endsWith("3sd") ||
|
||||
@@ -2244,8 +2236,6 @@ function main() {
|
||||
|
||||
switch (option.kind) {
|
||||
case "chart": {
|
||||
console.log("chart", option);
|
||||
|
||||
element = elements.charts;
|
||||
|
||||
lastChartOption.set(option);
|
||||
|
||||
@@ -1,36 +1,19 @@
|
||||
// @ts-check
|
||||
|
||||
const version = "v1";
|
||||
|
||||
self.addEventListener("install", (_event) => {
|
||||
console.log("service-worker: install");
|
||||
|
||||
const event = /** @type {any} */ (_event);
|
||||
|
||||
event.waitUntil(
|
||||
caches.open(version).then((cache) => {
|
||||
return cache.addAll([
|
||||
"/",
|
||||
"/index.html",
|
||||
"/assets/fonts/geist_mono_var_1_4_01.woff2",
|
||||
"/scripts/main.js",
|
||||
"/scripts/options.js",
|
||||
"/scripts/chart.js",
|
||||
"/styles/chart.css",
|
||||
"/scripts/simulation.js",
|
||||
"/styles/simulation.css",
|
||||
"/packages/lean-qr/v2.3.4/script.js",
|
||||
"/packages/lightweight-charts/v5.0.6-treeshaked/script.js",
|
||||
"/packages/solid-signals/v0.3.0-treeshaked/script.js",
|
||||
"/packages/ufuzzy/v1.0.14/script.js",
|
||||
]);
|
||||
}),
|
||||
);
|
||||
|
||||
// @ts-ignore
|
||||
console.log("sw: install");
|
||||
// The worker skips waiting and becomes active immediately
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
console.log("sw: active");
|
||||
event.waitUntil(
|
||||
// Claim clients, so the SW starts controlling pages immediately
|
||||
self.clients.claim(),
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (_event) => {
|
||||
const event = /** @type {any} */ (_event);
|
||||
|
||||
@@ -56,18 +39,20 @@ self.addEventListener("fetch", (_event) => {
|
||||
}
|
||||
request = new Request(url, request.mode !== "navigate" ? request : undefined);
|
||||
|
||||
console.log(`service-worker: fetching: ${url}`);
|
||||
console.log(request);
|
||||
|
||||
console.log(`service-worker: fetch ${url}`);
|
||||
|
||||
event.respondWith(
|
||||
caches.match(request).then(async (cachedResponse) => {
|
||||
return fetch(request)
|
||||
.then((response) => {
|
||||
const { status } = response;
|
||||
const { status, type } = response;
|
||||
|
||||
if (method !== "GET" || slashApiSlashMatches) {
|
||||
// API calls are cached in script.js
|
||||
return response;
|
||||
} else if (status === 200 || status === 304) {
|
||||
} else if ((status === 200 || status === 304) && type === "basic") {
|
||||
if (status === 200) {
|
||||
const clonedResponse = response.clone();
|
||||
caches.open(version).then((cache) => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user