File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
governance/xc_admin/packages/xc_admin_common/src/programs/core Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,7 @@ export function getConfig(params: GetConfigParams): RawConfig {
221
221
const rawConfig : RawConfig = { mappingAccounts : [ ] } ;
222
222
223
223
// Process mapping accounts
224
+ const processedProducts = new Map < string , boolean > ( ) ;
224
225
const mappingAccounts = accounts
225
226
. filter (
226
227
( account ) =>
@@ -232,10 +233,16 @@ export function getConfig(params: GetConfigParams): RawConfig {
232
233
next : parsed . nextMappingAccount ,
233
234
address : account . pubkey ,
234
235
products : parsed . productAccountKeys
235
- . filter ( ( key ) => productRawConfigs [ key . toBase58 ( ) ] )
236
+ . filter ( ( key ) => {
237
+ const keyStr = key . toBase58 ( ) ;
238
+ // Only include products that exist and haven't been processed yet
239
+ return productRawConfigs [ keyStr ] && ! processedProducts . has ( keyStr ) ;
240
+ } )
236
241
. map ( ( key ) => {
237
- const product = productRawConfigs [ key . toBase58 ( ) ] ;
238
- delete productRawConfigs [ key . toBase58 ( ) ] ;
242
+ const keyStr = key . toBase58 ( ) ;
243
+ const product = productRawConfigs [ keyStr ] ;
244
+ // Mark this product as processed
245
+ processedProducts . set ( keyStr , true ) ;
239
246
return product ;
240
247
} ) ,
241
248
} ;
You can’t perform that action at this time.
0 commit comments