Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/composables/transactionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function useTransactionList({
...transactionsLoaded.value,
]);

function resetState() {
function resetTransactionListState() {
state.value = {
accountAddress,
assetContractId,
Expand Down Expand Up @@ -148,7 +148,7 @@ export function useTransactionList({
async function initializeTransactionListPolling() {
if (!state.value.isInitialLoadDone || !transactionsLoaded.value.length) {
if (state.value.isInitialLoadDone && !transactionsLoaded.value.length) {
resetState();
resetTransactionListState();
}
await loadCurrentPageTransactions();
if (
Expand Down Expand Up @@ -208,7 +208,7 @@ export function useTransactionList({
|| state.value.assetContractId !== assetContractId
|| state.value.networkName !== activeNetwork.value.name
) {
resetState();
resetTransactionListState();
}

return {
Expand All @@ -220,5 +220,6 @@ export function useTransactionList({
loadCurrentPageTransactions,
initializeTransactionListPolling,
stopTransactionListPolling,
resetTransactionListState,
};
}
11 changes: 9 additions & 2 deletions src/popup/components/Modals/ResetWalletModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@
import { defineComponent, PropType } from 'vue';
import { useRouter } from 'vue-router';
import type { RejectCallback, ResolveCallback } from '@/types';
import { IS_MOBILE_APP } from '@/constants';
import { IS_MOBILE_APP, PROTOCOLS } from '@/constants';
import {
useAccounts,
useAeSdk,
useModals,
useNetworks,
usePermissions,
useTransactionList,
useUi,
} from '@/composables';
import { ROUTE_INDEX } from '@/popup/router/routeNames';
Expand Down Expand Up @@ -98,13 +99,20 @@ export default defineComponent({
const { resetPermissions } = usePermissions();
const { closeAllModals } = useModals();

const { resetTransactionListState } = useTransactionList({
protocol: PROTOCOLS.aeternity,
accountAddress: null as any, // `any` use deliberately to force setting empty state
});

async function onReset() {
resetAccounts();
resetNetworks();
resetUiSettings();
disconnectDapps();
resetPermissions();
closeAllModals();
resetTransactionListState();
resetPermissions();

WalletStorage.clear();
if (IS_MOBILE_APP) {
Expand All @@ -117,7 +125,6 @@ export default defineComponent({
await router.push({ name: ROUTE_INDEX });

props.resolve();
window.location.reload();
}

return {
Expand Down