Skip to content

Commit

Permalink
Merge pull request #164 from zkLinkProtocol/fix/withdraw_chain_displa…
Browse files Browse the repository at this point in the history
…y_issue

fix withdrawal chain display issue
  • Loading branch information
leochw authored Apr 22, 2024
2 parents fed978e + 5795b92 commit 9cba9c3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions store/zksync/withdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ export const useZkSyncWithdrawalsStore = defineStore("zkSyncWithdrawals", () =>

const transactionFromStorage = transactionStatusStore.getTransaction(withdrawal.transactionHash);
if (transactionFromStorage) {
// check if tx.to.destination is matching with tx.token.networkKey for erc20
if (
transactionFromStorage.to.destination.key !== transactionFromStorage.token.networkKey &&
transactionFromStorage.token.symbol !== "ETH"
) {
const { selectedNetwork } = storeToRefs(useNetworkStore());
const eraNetworks = getNetworkInfo(withdrawal) || selectedNetwork.value;
const obj = {
iconUrl: eraNetworks.logoUrl!,
key: "nova",
label: eraNetworks?.l1Network?.name ?? "",
};
transactionStatusStore.updateTransactionData(withdrawal.transactionHash, {
...transactionFromStorage,
to: {
...transactionFromStorage.to,
destination: obj,
},
});
}
if (!transactionFromStorage.info.completed) {
await setStatus(withdrawal);
await sleep(200);
Expand Down

0 comments on commit 9cba9c3

Please sign in to comment.