From 2cf80a9e4a80fef2df3eb2b3c64d89fe2cc394b1 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 9 Nov 2024 18:50:02 +0700 Subject: [PATCH] todo chainhead follow --- src/pages/Explorer/block.state.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/Explorer/block.state.ts b/src/pages/Explorer/block.state.ts index 2720178..1f56454 100644 --- a/src/pages/Explorer/block.state.ts +++ b/src/pages/Explorer/block.state.ts @@ -4,10 +4,7 @@ import { PinnedBlocks, SystemEvent, } from "@polkadot-api/observable-client" -import { - FollowEventWithRuntime, - StopError, -} from "@polkadot-api/substrate-client" +import { StopError } from "@polkadot-api/substrate-client" import { state, withDefault } from "@react-rxjs/core" import { partitionByKey, toKeySet } from "@react-rxjs/utils" import { HexString } from "polkadot-api" @@ -26,6 +23,7 @@ import { mergeMap, NEVER, Observable, + ObservedValueOf, of, repeat, retry, @@ -277,7 +275,7 @@ export const blocksByHeight$ = state( ) function withInitializedNumber() { - return (source$: Observable) => + return (source$: Observable>) => source$.pipe( withLatestFrom(chainHead$), concatMap(([event, chainHead]) => {