From c974870311ffc94511133f044616415534b95170 Mon Sep 17 00:00:00 2001 From: Victor Oliva Date: Thu, 31 Oct 2024 08:44:21 +0100 Subject: [PATCH] fix positioning when multiple blocks in one fork --- src/pages/Explorer/Explorer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Explorer/Explorer.tsx b/src/pages/Explorer/Explorer.tsx index 5c4088f..89883e8 100644 --- a/src/pages/Explorer/Explorer.tsx +++ b/src/pages/Explorer/Explorer.tsx @@ -89,9 +89,9 @@ const blockTable$ = blocksByHeight$.pipeState( if (height === best.number) { competingBlocks.sort((a) => (a.hash === best.hash ? -1 : 1)) } else { - competingBlocks.sort((a) => + competingBlocks.sort((a, b) => (blockPositions[a.hash] ?? Number.POSITIVE_INFINITY) < - (blockPositions[best.hash] ?? Number.POSITIVE_INFINITY) + (blockPositions[b.hash] ?? Number.POSITIVE_INFINITY) ? -1 : 1, )