Skip to content

Commit

Permalink
Merge pull request #2793 from superhero-com/feature/reset-filters-on-…
Browse files Browse the repository at this point in the history
…unmounted

fix: do not show previous page filters
  • Loading branch information
CedrikNikita authored Mar 5, 2024
2 parents cc93d3d + 9e702be commit b9b565d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/popup/components/AccountDetailsBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ import {
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
import { useRoute } from 'vue-router';
import { IS_MOBILE_APP, IS_FIREFOX } from '@/constants';
import {
useAccounts,
useBalances,
useTransactionAndTokenFilter,
useUi,
useScrollConfig,
} from '@/composables';
Expand Down Expand Up @@ -121,7 +119,6 @@ export default defineComponent({
const ionRouter = useIonRouter();
const { activeAccount } = useAccounts();
const { resetFilter } = useTransactionAndTokenFilter();
const { isScrollEnabled } = useScrollConfig();
const { homeRouteName } = useUi();
const { balance } = useBalances();
Expand Down Expand Up @@ -153,13 +150,6 @@ export default defineComponent({
resizeObserver.value.observe(headerEl.value!);
}
watch(
() => route,
() => {
resetFilter();
},
);
onMounted(() => {
observeTabsHeight();
// The timeout ensures that the height is calculated correctly in some edge cases
Expand Down
6 changes: 5 additions & 1 deletion src/popup/components/TransactionAndTokenFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
computed,
defineComponent,
onMounted,
onUnmounted,
ref,
watch,
} from 'vue';
Expand Down Expand Up @@ -69,6 +70,7 @@ export default defineComponent({
displayMode,
filtersConfig,
filtersConfigAe,
resetFilter,
} = useTransactionAndTokenFilter();
const { viewportElement } = useViewport();
Expand Down Expand Up @@ -122,14 +124,16 @@ export default defineComponent({
}
});
onMounted(async () => {
onMounted(() => {
if (showFilterBar.value) {
maxHeight.value = (transactionFilterEl?.value)?.clientHeight!;
firstRender.value = false;
observeFilterElHeight();
}
});
onUnmounted(() => resetFilter());
return {
transactionFilterEl,
searchPhrase,
Expand Down

0 comments on commit b9b565d

Please sign in to comment.