From 40c71ef47b299fadc398850a89fa77713605ec55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:53:14 +0000 Subject: [PATCH 1/4] Bump word-wrap from 1.2.3 to 1.2.5 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 995dcb7f6..e28ae9fdb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14747,9 +14747,9 @@ wildcard@^2.0.0: integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== wrap-ansi@^6.2.0: version "6.2.0" From a6589d8fd167662583bdc55ee583112a22f405ed Mon Sep 17 00:00:00 2001 From: Ezra Sowden-Guzman Date: Mon, 24 Jul 2023 18:22:18 -0400 Subject: [PATCH 2/4] clear stores on login-logout --- src/antelope/stores/account.ts | 11 ++++++++++- src/antelope/stores/balances.ts | 4 ++++ src/antelope/stores/history.ts | 7 +++++++ src/antelope/stores/nfts.ts | 8 ++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/antelope/stores/account.ts b/src/antelope/stores/account.ts index 0ce6145fc..cc694270d 100644 --- a/src/antelope/stores/account.ts +++ b/src/antelope/stores/account.ts @@ -19,7 +19,8 @@ import { API } from '@greymass/eosio'; import { createInitFunction, createTraceFunction } from 'src/antelope/stores/feedback'; import { initFuelUserWrapper } from 'src/api/fuel'; import { - useFeedbackStore, + useBalancesStore, + useFeedbackStore, useHistoryStore, useNftsStore, } from 'src/antelope'; import { getAntelope, useChainStore } from 'src/antelope'; import { errorToString } from 'src/antelope/config'; @@ -151,6 +152,10 @@ export const useAccountStore = defineStore(store_name, { async loginEVM({ authenticator, network }: LoginEVMActionData): Promise { this.trace('loginEVM', network); + useHistoryStore().clearEvmTransactions(); + useBalancesStore().clearBalances(); + useNftsStore().clearNFTs(); + let success = false; try { const rawAddress = await authenticator.login(network); @@ -197,6 +202,10 @@ export const useAccountStore = defineStore(store_name, { async logout() { this.trace('logout'); + useHistoryStore().clearEvmTransactions(); + useBalancesStore().clearBalances(); + useNftsStore().clearNFTs(); + try { localStorage.removeItem('network'); localStorage.removeItem('account'); diff --git a/src/antelope/stores/balances.ts b/src/antelope/stores/balances.ts index 79b9bce0c..af41008fb 100644 --- a/src/antelope/stores/balances.ts +++ b/src/antelope/stores/balances.ts @@ -383,6 +383,10 @@ export const useBalancesStore = defineStore(store_name, { this.__wagmiTokenTransferConfig[label] = config; }, + clearBalances() { + this.trace('clearBalances'); + this.__balances = {}; + }, }, }); diff --git a/src/antelope/stores/history.ts b/src/antelope/stores/history.ts index 834faaae2..7db9569bc 100644 --- a/src/antelope/stores/history.ts +++ b/src/antelope/stores/history.ts @@ -290,6 +290,13 @@ export const useHistoryStore = defineStore(store_name, { this.trace('setEvmTransactionsRowCount', count); this.__total_evm_transaction_count[label] = count; }, + clearEvmTransactions() { + this.trace('clearEvmTransactions'); + this.setEVMTransactionsFilter({ address: '' }); + this.setEVMTransactions('current', []); + this.setShapedTransactionRows('current', []); + this.setEvmTransactionsRowCount('current', 0); + }, }, }); diff --git a/src/antelope/stores/nfts.ts b/src/antelope/stores/nfts.ts index 71ba02173..2c80465c5 100644 --- a/src/antelope/stores/nfts.ts +++ b/src/antelope/stores/nfts.ts @@ -271,6 +271,14 @@ export const useNftsStore = defineStore(store_name, { setUserFilter(filter: UserNftFilter) { this.__user_filter = filter; }, + clearNFTs() { + this.__inventory = {}; + this.setUserFilter({}); + this.setPaginationFilter({ + address: '', + limit: 10000, + }); + }, }, }); From be24e5f3b5ed0b9be1c827676e6bdceef5b2cb1d Mon Sep 17 00:00:00 2001 From: Ezra Sowden-Guzman Date: Mon, 24 Jul 2023 18:28:03 -0400 Subject: [PATCH 3/4] cleanup --- src/antelope/stores/account.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/antelope/stores/account.ts b/src/antelope/stores/account.ts index cc694270d..86b504969 100644 --- a/src/antelope/stores/account.ts +++ b/src/antelope/stores/account.ts @@ -20,7 +20,9 @@ import { createInitFunction, createTraceFunction } from 'src/antelope/stores/fee import { initFuelUserWrapper } from 'src/api/fuel'; import { useBalancesStore, - useFeedbackStore, useHistoryStore, useNftsStore, + useFeedbackStore, + useHistoryStore, + useNftsStore, } from 'src/antelope'; import { getAntelope, useChainStore } from 'src/antelope'; import { errorToString } from 'src/antelope/config'; From d8e9df469180ae0f102a0e2a24824a07a126c29a Mon Sep 17 00:00:00 2001 From: Ezra Sowden-Guzman Date: Mon, 24 Jul 2023 18:28:42 -0400 Subject: [PATCH 4/4] add trace --- src/antelope/stores/nfts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/antelope/stores/nfts.ts b/src/antelope/stores/nfts.ts index 2c80465c5..baff4fd57 100644 --- a/src/antelope/stores/nfts.ts +++ b/src/antelope/stores/nfts.ts @@ -272,6 +272,7 @@ export const useNftsStore = defineStore(store_name, { this.__user_filter = filter; }, clearNFTs() { + this.trace('clearNFTs'); this.__inventory = {}; this.setUserFilter({}); this.setPaginationFilter({