diff --git a/explorer/src/lib/components/navbar/Navbar.svelte b/explorer/src/lib/components/navbar/Navbar.svelte
index 32c2969c12..73c2dec8ba 100644
--- a/explorer/src/lib/components/navbar/Navbar.svelte
+++ b/explorer/src/lib/components/navbar/Navbar.svelte
@@ -49,7 +49,7 @@
/**
* @param {Event} e
*/
- function handleChange(e) {
+ function handleNetworkChange(e) {
// @ts-ignore
appStore.setNetwork(e.target.value);
}
@@ -94,7 +94,7 @@
>
diff --git a/explorer/src/lib/containers/statistics-panel/StatisticsPanel.svelte b/explorer/src/lib/containers/statistics-panel/StatisticsPanel.svelte
index a0baddbb7c..e0571daf54 100644
--- a/explorer/src/lib/containers/statistics-panel/StatisticsPanel.svelte
+++ b/explorer/src/lib/containers/statistics-panel/StatisticsPanel.svelte
@@ -42,8 +42,10 @@
);
onNetworkChange((network) => {
- marketDataStore.getData(network);
+ marketDataStore.getData();
+ nodeLocationsStore.reset();
nodeLocationsStore.getData(network);
+ pollingStatsDataStore.reset();
pollingStatsDataStore.start(network);
});
diff --git a/explorer/src/routes/+page.svelte b/explorer/src/routes/+page.svelte
index 31088dd666..8d0292bb66 100644
--- a/explorer/src/routes/+page.svelte
+++ b/explorer/src/routes/+page.svelte
@@ -13,15 +13,13 @@
$appStore.fetchInterval
);
- onNetworkChange(pollingDataStore.start);
- onDestroy(pollingDataStore.stop);
-
$: ({ data, error, isLoading } = $pollingDataStore);
onNetworkChange((network) => {
- pollingDataStore.stop();
+ pollingDataStore.reset();
pollingDataStore.start(network);
});
+ onDestroy(pollingDataStore.stop);
diff --git a/explorer/src/routes/blocks/+page.svelte b/explorer/src/routes/blocks/+page.svelte
index 15dc92c91a..e580abb818 100644
--- a/explorer/src/routes/blocks/+page.svelte
+++ b/explorer/src/routes/blocks/+page.svelte
@@ -12,9 +12,10 @@
);
$: ({ data, error, isLoading } = $pollingDataStore);
+ $: ({ network: currentNetwork } = $appStore);
onNetworkChange((network) => {
- pollingDataStore.stop();
+ pollingDataStore.reset();
pollingDataStore.start(network);
});
@@ -23,7 +24,7 @@
pollingDataStore.start(currentNetwork)}
blocks={data}
{error}
loading={isLoading}
diff --git a/explorer/src/routes/blocks/block/+page.svelte b/explorer/src/routes/blocks/block/+page.svelte
index 41bd6a5b06..a222d48a1a 100644
--- a/explorer/src/routes/blocks/block/+page.svelte
+++ b/explorer/src/routes/blocks/block/+page.svelte
@@ -5,7 +5,6 @@
import { appStore } from "$lib/stores";
import { createDataStore } from "$lib/dusk/svelte-stores";
import { onNetworkChange } from "$lib/lifecyles";
- import { onMount } from "svelte";
const dataStore = createDataStore(duskAPI.getBlock);
@@ -13,13 +12,12 @@
dataStore.getData($appStore.network, $page.url.searchParams.get("id"));
};
- onNetworkChange(getBlock);
-
- $: ({ data, error, isLoading } = $dataStore);
-
- onMount(() => {
+ onNetworkChange(() => {
+ dataStore.reset();
getBlock();
});
+
+ $: ({ data, error, isLoading } = $dataStore);
diff --git a/explorer/src/routes/transactions/+page.svelte b/explorer/src/routes/transactions/+page.svelte
index f08dbc4ded..f79b29d77f 100644
--- a/explorer/src/routes/transactions/+page.svelte
+++ b/explorer/src/routes/transactions/+page.svelte
@@ -12,9 +12,10 @@
);
$: ({ data, error, isLoading } = $pollingDataStore);
+ $: ({ network: currentNetwork } = $appStore);
onNetworkChange((network) => {
- pollingDataStore.stop();
+ pollingDataStore.reset();
pollingDataStore.start(network);
});
@@ -23,7 +24,7 @@
pollingDataStore.start(currentNetwork)}
txs={data}
{error}
loading={isLoading}
diff --git a/explorer/src/routes/transactions/transaction/+page.svelte b/explorer/src/routes/transactions/transaction/+page.svelte
index bd7820a370..63011b5e53 100644
--- a/explorer/src/routes/transactions/transaction/+page.svelte
+++ b/explorer/src/routes/transactions/transaction/+page.svelte
@@ -17,7 +17,11 @@
marketStore.getData($appStore.network);
};
- onNetworkChange(getTransaction);
+ onNetworkChange(() => {
+ dataStore.reset();
+ payloadStore.reset();
+ getTransaction();
+ });
$: ({ data, error, isLoading } = $dataStore);
$: ({ data: payloadData } = $payloadStore);