diff --git a/dashboard/src/views/AppsView.vue b/dashboard/src/views/AppsView.vue index 756081618..5b85be427 100644 --- a/dashboard/src/views/AppsView.vue +++ b/dashboard/src/views/AppsView.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; const i18n = useI18n(); const t = i18n.t; -import { ref, computed, useTemplateRef, onActivated, onMounted, onUnmounted, inject } from 'vue'; +import { ref, computed, useTemplateRef, onActivated, onDeactivated, inject } from 'vue'; import { Button, Menu, SingleSelect, Icon, TableView, TextInput, ProgressBar } from '@cloudron/pankow'; import { API_ORIGIN, APP_TYPES, HSTATES, ISTATES, RSTATES } from '../constants.js'; import AppsModel from '../models/AppsModel.js'; @@ -237,10 +237,7 @@ function toggleView() { onActivated(async () => { await refreshApps(); -}); - -onMounted(async () => { - await refreshApps(); + ready.value = true; const [error, result] = await domainsModel.list(); if (error) return console.error(error); @@ -251,12 +248,12 @@ onMounted(async () => { stateFilter.value = stateFilterOptions[0].id; tagFilter.value = tagFilterOptions.value[0].id; - ready.value = true; - refreshInterval = setInterval(refreshApps, 5000); }); -onUnmounted(() => { +onDeactivated(() => { + filter.value = ''; + clearInterval(refreshInterval); }); diff --git a/dashboard/src/views/AppstoreView.vue b/dashboard/src/views/AppstoreView.vue index 7cf706194..c25945a65 100644 --- a/dashboard/src/views/AppstoreView.vue +++ b/dashboard/src/views/AppstoreView.vue @@ -179,9 +179,6 @@ function setItemWidth() { } onActivated(async () => { - search.value = ''; - category.value = ''; - setItemWidth(); await getAppList(); @@ -196,6 +193,9 @@ onActivated(async () => { }); onDeactivated(() => { + search.value = ''; + category.value = ''; + window.removeEventListener('hashchange', onHashChange); window.removeEventListener('resize', setItemWidth); });