@@ -189,7 +189,7 @@ import ResourceListTable from '@/components/ResourceListTable.vue';
189189import { useCoreStore } from ' @/stores/core' ;
190190import { useFiltersStore } from ' @/stores/filters' ;
191191import { callAdminForthApi , currentQuery , getIcon , setQuery } from ' @/utils' ;
192- import { computed , onMounted , ref , watch , nextTick , type Ref } from ' vue' ;
192+ import { computed , onMounted , onUnmounted , ref , watch , nextTick , type Ref } from ' vue' ;
193193import { useRoute } from ' vue-router' ;
194194import { showErrorTost } from ' @/composables/useFrontendApi'
195195import { getCustomComponent , initThreeDotsDropdown } from ' @/utils' ;
@@ -387,6 +387,13 @@ class SortQuerySerializer {
387387
388388let listAutorefresher: any = null ;
389389
390+ function clearAutoRefresher() {
391+ if (listAutorefresher ) {
392+ clearInterval (listAutorefresher );
393+ listAutorefresher = null ;
394+ }
395+ }
396+
390397async function init() {
391398
392399 await coreStore .fetchResourceFull ({
@@ -434,10 +441,7 @@ async function init() {
434441 }
435442 });
436443
437- if (listAutorefresher ) {
438- clearInterval (listAutorefresher );
439- listAutorefresher = null ;
440- }
444+ clearAutoRefresher ();
441445 if (coreStore .resource ! .options ?.listRowsAutoRefreshSeconds ) {
442446 listAutorefresher = setInterval (async () => {
443447 await adminforth .list .silentRefresh ();
@@ -505,6 +509,10 @@ onMounted(async () => {
505509 initInProcess = false ;
506510});
507511
512+ onUnmounted (() => {
513+ clearAutoRefresher ();
514+ });
515+
508516watch ([page ], async () => {
509517 setQuery ({ page: page .value });
510518});
0 commit comments