From a7bce3a63615648b3cece7f35642217ba1cb9824 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:57:48 +0100 Subject: [PATCH] simplify local storage sync --- templates/cashu/wallet.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/cashu/wallet.html b/templates/cashu/wallet.html index 4336b173a..3b5130556 100644 --- a/templates/cashu/wallet.html +++ b/templates/cashu/wallet.html @@ -2725,12 +2725,11 @@ page_container %} // makes sure that local storage stays up to date // in multiple tabs of the same window window.addEventListener('storage', e => { - console.log(`Key Changed: ${e.key}`) - console.log(`New Value: ${e.newValue}`) - localStorage.setItem(e.key, e.newValue) + // console.log(`Key Changed: ${e.key}`) + // console.log(`New Value: ${e.newValue}`) // if these were the proofs, reload them if (e.key == 'cashu.proofs') { - this.proofs = JSON.parse(localStorage.getItem('cashu.proofs')) + this.proofs = JSON.parse(e.newValue) } // if these were the activeMintUrl, reload if (e.key == 'cashu.activeMintURL') {