Skip to content

Commit

Permalink
compare results
Browse files Browse the repository at this point in the history
  • Loading branch information
findolor committed Feb 20, 2025
1 parent 90d9769 commit c83b1db
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,14 @@
areAllTokensSelected();
}
function areTokenInfosEqual(a: AllTokenInfos, b: AllTokenInfos): boolean {
if (a.length !== b.length) return false;
return a.every((tokenInfo, index) => {
const bTokenInfo = b[index];
return (
tokenInfo.address === bTokenInfo.address &&
tokenInfo.decimals === bTokenInfo.decimals &&
tokenInfo.name === bTokenInfo.name &&
tokenInfo.symbol === bTokenInfo.symbol
);
});
}
async function onSelectTokenSelect() {
if (!gui) return;
await areAllTokensSelected();
if (allTokensSelected) {
let newAllTokenInfos = await gui.getAllTokenInfos();
if (!areTokenInfosEqual(newAllTokenInfos, allTokenInfos)) {
if (allTokenInfos !== newAllTokenInfos) {
allTokenInfos = newAllTokenInfos;
getAllDepositFields();
getAllFieldDefinitions();
Expand Down

0 comments on commit c83b1db

Please sign in to comment.