Clear filter states in onDeactivated() instead of onActivated() to ber fresh on view
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user