From e3de337769e7d5a535b4a03f0fb725bc84188ce7 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 1 Feb 2022 18:57:53 +0100 Subject: [PATCH] Move reactive config part into session state This PR moves the signer "clones" the signer property from the `Config` object into the `session` state, to allow Svelte reactivity, e.g. in the Testnet Faucet, where we rely on `config.signer` but since it only changes when the `Config` object in `App.svelte` changes we can't react on it. For now I only cloned the signer property, if we see in the future that there are other properties that need to change with session we can add them. Signed-off-by: Sebastian Martinez Signed-off-by: Alexis Sellier --- src/Header.svelte | 3 +-- src/base/faucet/Index.svelte | 38 ++++++++++++++++++++------------- src/base/faucet/Withdraw.svelte | 14 +++++++----- src/base/faucet/lib.ts | 30 +++++++++++++++----------- src/session.ts | 28 ++++++++++++++++++------ 5 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/Header.svelte b/src/Header.svelte index d54dfc5d6..872595605 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -17,7 +17,6 @@ export let session: Session | null; export let config: Config; - let sessionButton: HTMLElement | null = null; let sessionButtonHover = false; let mobileNavbarDisplayed = false; @@ -182,7 +181,7 @@ {/if} -