From ffe00bb12b3afe35526243d41364ec1b0dd089a6 Mon Sep 17 00:00:00 2001 From: katherine sullivan Date: Thu, 4 Dec 2025 02:32:24 -0300 Subject: [PATCH] add missing chains when having l1store cached --- components/toolbox/stores/l1ListStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/toolbox/stores/l1ListStore.ts b/components/toolbox/stores/l1ListStore.ts index 2bd27eaac1f..3c7a7a10fe7 100644 --- a/components/toolbox/stores/l1ListStore.ts +++ b/components/toolbox/stores/l1ListStore.ts @@ -202,6 +202,12 @@ export const getL1ListStore = (isTestnet: boolean) => { { name: `${STORE_VERSION}-l1-list-store-testnet`, storage: createJSONStorage(localStorageComp), + merge: (persisted: any, current: any) => { + if (!persisted?.l1List) return current; + const persistedIds = new Set(persisted.l1List.map((l: L1ListItem) => l.id)); + const missing = l1ListInitialStateFuji.l1List.filter(l => !persistedIds.has(l.id)); + return { ...current, l1List: [...persisted.l1List, ...missing] }; + }, }, ), );