Skip to content

Commit ac72065

Browse files
cursoragentpaullinator
authored andcommitted
fixup! Cache and restore wallets
1 parent a528d6f commit ac72065

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/core/cache/cached-currency-config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ export function makeCachedCurrencyConfig(
7272
// Build token maps from cached data (cached tokens are EdgeTokens)
7373
const allTokens: EdgeTokenMap = cacheFile.tokens[pluginId] ?? {}
7474
const customTokens: EdgeTokenMap = cacheFile.customTokens[pluginId] ?? {}
75+
// Compute builtinTokens by excluding custom tokens from allTokens
76+
const builtinTokens: EdgeTokenMap = Object.fromEntries(
77+
Object.entries(allTokens).filter(
78+
([tokenId]) => customTokens[tokenId] == null
79+
)
80+
)
7581

7682
// Get otherMethods names for this plugin
7783
const otherMethodNames = cacheFile.configOtherMethodNames[pluginId] ?? []
@@ -88,7 +94,7 @@ export function makeCachedCurrencyConfig(
8894
},
8995
get builtinTokens(): EdgeTokenMap {
9096
const realConfig = tryGetRealConfig()
91-
return realConfig != null ? realConfig.builtinTokens : allTokens
97+
return realConfig != null ? realConfig.builtinTokens : builtinTokens
9298
},
9399
get customTokens(): EdgeTokenMap {
94100
const realConfig = tryGetRealConfig()

0 commit comments

Comments
 (0)