Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions applications/viewer/src/routes/NetworkInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
let error: string | null = null;
let lastFetchedEpoch: number = 0;
let store: any;
let unsubscribe: (() => void) | null = null;

async function fetchEpochData() {
try {
Expand Down Expand Up @@ -84,12 +85,12 @@
onMount(async () => {
const importedStore = await import('./blocks/store.js');
store = importedStore;
store.blocksStore.subscribe(handleStoreMessage);
unsubscribe = store.blocksStore.subscribe(handleStoreMessage);
});

onDestroy(() => {
if (store) {
store.blocksStore.subscribe(() => {})();
if (unsubscribe) {
unsubscribe();
}
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion applications/viewer/src/routes/blocks/RecentBlocks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</h3>
<p class="text-sm text-gray-600"><span class="font-bold">Slot</span> {block.slot}</p>
<p class="text-sm text-gray-600"><span class="font-bold">Txs</span> {block.ntx}</p>
<p class="text-sm text-gray-600"><span class="font-bold">Size</span> {block.size / 1000}</p>
<p class="text-sm text-gray-600"><span class="font-bold">Size</span> {(block.size / 1024).toFixed(2)} kb</p>
<p class="text-sm text-gray-600 break-words"><span class="font-bold">Pool</span> {block.slot_leader}</p>
<p class="text-sm text-gray-600">
<span class="text-xs text-gray-500">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const load: PageLoad = async ({params, url}) => {

return {
status: 404,
body: { error: 'Can not fetch recepie.' }
body: { error: 'Can not fetch transactions.' }
};

}
Loading