Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/telosnetwork/telos-wallet
Browse files Browse the repository at this point in the history
…into 463-adding-oreid-authenticator
  • Loading branch information
donnyquixotic committed Jul 27, 2023
2 parents 261ff70 + d8e9df4 commit a4a8292
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/antelope/stores/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { API } from '@greymass/eosio';
import { createInitFunction, createTraceFunction } from 'src/antelope/stores/feedback';
import { initFuelUserWrapper } from 'src/api/fuel';
import {
useBalancesStore,
useFeedbackStore,
useHistoryStore,
useNftsStore,
} from 'src/antelope';
import { getAntelope, useChainStore } from 'src/antelope';
import { errorToString } from 'src/antelope/config';
Expand Down Expand Up @@ -151,6 +154,10 @@ export const useAccountStore = defineStore(store_name, {

async loginEVM({ authenticator, network }: LoginEVMActionData): Promise<boolean> {
this.trace('loginEVM', network);
useHistoryStore().clearEvmTransactions();
useBalancesStore().clearBalances();
useNftsStore().clearNFTs();

let success = false;
try {
const rawAddress = await authenticator.login(network);
Expand Down Expand Up @@ -197,6 +204,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');
Expand Down
4 changes: 4 additions & 0 deletions src/antelope/stores/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ export const useBalancesStore = defineStore(store_name, {

this.__wagmiTokenTransferConfig[label] = config;
},
clearBalances() {
this.trace('clearBalances');
this.__balances = {};
},
},
});

Expand Down
7 changes: 7 additions & 0 deletions src/antelope/stores/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
},
});

Expand Down
9 changes: 9 additions & 0 deletions src/antelope/stores/nfts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ export const useNftsStore = defineStore(store_name, {
setUserFilter(filter: UserNftFilter) {
this.__user_filter = filter;
},
clearNFTs() {
this.trace('clearNFTs');
this.__inventory = {};
this.setUserFilter({});
this.setPaginationFilter({
address: '',
limit: 10000,
});
},
},
});

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14899,9 +14899,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"
Expand Down

0 comments on commit a4a8292

Please sign in to comment.