Skip to content

Commit dd01b71

Browse files
committed
feat: cleans leftover tokens on net change
1 parent a0a0ea1 commit dd01b71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sagas/networkSettings.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,13 @@ export function* persistNetworkSettings(action) {
293293

294294
// Stop wallet and clean its storage without clean its access data.
295295
wallet.stop({ cleanStorage: true, cleanAddresses: true, cleanTokens: true });
296+
297+
// Clean transaction history, addresses and registered tokens from local storage as well
298+
const storage = STORE.getStorage();
299+
yield call([storage, storage.cleanStorage], true, true, true);
300+
296301
// This action should clean the tokens history on redux.
297-
// In addition, the reload also clean the inmemory storage.
302+
// In addition, the reload also clean the in memory storage.
298303
yield put(reloadWalletRequested());
299304
}
300305

0 commit comments

Comments
 (0)