From 10e255599fd247ada1598808a0686a84992a7d6b Mon Sep 17 00:00:00 2001 From: Duddino Date: Wed, 20 Sep 2023 20:07:35 +0200 Subject: [PATCH] Reset activityDashboard when changing explorer --- scripts/Activity.vue | 3 ++- scripts/network.js | 2 +- scripts/settings.js | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/Activity.vue b/scripts/Activity.vue index b6b34e0c5..e546cedef 100644 --- a/scripts/Activity.vue +++ b/scripts/Activity.vue @@ -60,7 +60,8 @@ async function update(fNewOnly = false, sync = true) { if (!cNet) return; // Prevent the user from spamming refreshes - if (cNet.historySyncing) return; + if (updating.value) return; + let arrTXs; try { // Set the updating animation diff --git a/scripts/network.js b/scripts/network.js index 59a6efb3b..59e28553f 100644 --- a/scripts/network.js +++ b/scripts/network.js @@ -368,7 +368,7 @@ export class ExplorerNetwork extends Network { async syncTxHistoryChunk(fNewOnly = false) { // Do not allow multiple calls at once if (this.historySyncing) { - return false; + return this.arrTxHistory; } try { diff --git a/scripts/settings.js b/scripts/settings.js index a19324652..52dea42e2 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -275,6 +275,9 @@ export async function setExplorer(explorer, fSilent = false) { // Enable networking + notify if allowed const network = new ExplorerNetwork(cExplorer.url, wallet.getMasterKey()); setNetwork(network); + + activityDashboard.reset(); + stakingDashboard.reset(); // Update the selector UI doms.domExplorerSelect.value = cExplorer.url;