diff --git a/src/lib/server/context.js b/src/lib/server/context.js index 9f4f5f5..947d18e 100644 --- a/src/lib/server/context.js +++ b/src/lib/server/context.js @@ -60,19 +60,18 @@ Bun.file(`${import.meta.env.VITE_DB_PATH}/traditional_currency_list.json`) const watcher = watch(import.meta.env.VITE_DB_PATH, async (_, filename) => { const file = Bun.file(import.meta.env.VITE_DB_PATH + filename); - const contents = await file.json(); switch (filename) { case "offers_statistics.json": - offers.set(formatOffers(contents)); + offers.set(formatOffers(await file.json())); break; case "trade_statistics.json": - trades.set(formatTrades(contents)); + trades.set(formatTrades(await file.json())); break; case "crypto_currency_list.json": - crypto.set(formatCrypto(contents)); + crypto.set(formatCrypto(await file.json())); break; case "traditional_currency_list.json": - fiat.set(formatFiat(contents)); + fiat.set(formatFiat(await file.json())); break; } }); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 49a6d2b..5b5d490 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -15,22 +15,28 @@ Object.groupBy ||= (values, keyFinder) => {