-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(frontend): remove duplicated ICRC tokens with different index canisters #4411
base: main
Are you sure you want to change the base?
fix(frontend): remove duplicated ICRC tokens with different index canisters #4411
Conversation
@@ -42,12 +43,9 @@ export const icrcChainFusionDefaultTokens: Readable<IcToken[]> = derived( | |||
/** | |||
* A flatten list of the default Icrc Ledger and Index canister Ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, done!
@@ -67,8 +65,7 @@ const icrcDefaultTokensToggleable: Readable<IcTokenToggleable[]> = derived( | |||
([$icrcDefaultTokens, $icrcUserTokens]) => | |||
$icrcDefaultTokens.map(({ ledgerCanisterId, indexCanisterId, ...rest }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to destruct the indexCanisterId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we don't eheh! changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx
As discussed offline, tests will be provided later on in separate PR.
…with-different-index-canister
Motivation
There was an issue #4164 , that ICRC tokens that have different index canister (one
undefined
), before being added to the codebase, would appear twice after.Since we do not use the index canister ID as way to identify an ICRC token (it can be optional) anymore, we adapt all the checks in the derived stores to compare an ICRC to another ONLY via ledger canister ID.