From 8b6896c6962d3ad371f5e17f1a3ab20364a5f855 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 21 Mar 2022 16:28:33 +0000 Subject: bank improvements + reload fix for gitpod --- src/lib/sections/Bank.svelte | 26 +++++++++++++++++++------- svelte.config.js | 10 ++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/lib/sections/Bank.svelte b/src/lib/sections/Bank.svelte index 46c70c9..9bd2b8f 100644 --- a/src/lib/sections/Bank.svelte +++ b/src/lib/sections/Bank.svelte @@ -13,11 +13,20 @@ {#if data.profile.bank} -

- Current balance: {data.profile.bank.balance} coins -

+
+

+ Current bank balance: + + {data.profile.bank.balance?.toLocaleString()} coins + +

+

+ Purse: + + {data.member.purse.toLocaleString()} coins + +

+
{#each data.profile.bank.history as transaction}
@@ -30,7 +39,7 @@ - New balance: {transaction.total} + New balance: {transaction.total.toLocaleString()} 0} @@ -43,7 +52,7 @@ - {millisecondsToTime(Date.now() - transaction.timestamp)} + {millisecondsToTime(Date.now() - transaction.timestamp)} ago
{/each} @@ -74,4 +83,7 @@ .bank-main-current-balance-value { color: var(--theme-main-text); } + p { + margin: 0; + } diff --git a/svelte.config.js b/svelte.config.js index 31ba570..9af5c40 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -41,6 +41,16 @@ const config = { }, }, }, + // if the user is on replit or gitpod, use a secure websocket + server: + process.env.REPL_ID || process.env.GITPOD_WORKSPACE_ID + ? { + hmr: { + protocol: 'wss', + port: 443, + }, + } + : {}, }, } } -- cgit