adminforth 2.4.0-next.177 → 2.4.0-next.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,7 +189,7 @@ import ResourceListTable from '@/components/ResourceListTable.vue';
189
189
  import { useCoreStore } from '@/stores/core';
190
190
  import { useFiltersStore } from '@/stores/filters';
191
191
  import { 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';
193
193
  import { useRoute } from 'vue-router';
194
194
  import { showErrorTost } from '@/composables/useFrontendApi'
195
195
  import { getCustomComponent, initThreeDotsDropdown } from '@/utils';
@@ -387,6 +387,13 @@ class SortQuerySerializer {
387
387
 
388
388
  let listAutorefresher: any = null;
389
389
 
390
+ function clearAutoRefresher() {
391
+ if (listAutorefresher) {
392
+ clearInterval(listAutorefresher);
393
+ listAutorefresher = null;
394
+ }
395
+ }
396
+
390
397
  async function init() {
391
398
 
392
399
  await coreStore.fetchResourceFull({
@@ -434,10 +441,7 @@ async function init() {
434
441
  }
435
442
  });
436
443
 
437
- if (listAutorefresher) {
438
- clearInterval(listAutorefresher);
439
- listAutorefresher = null;
440
- }
444
+ clearAutoRefresher();
441
445
  if (coreStore.resource!.options?.listRowsAutoRefreshSeconds) {
442
446
  listAutorefresher = setInterval(async () => {
443
447
  await adminforth.list.silentRefresh();
@@ -505,6 +509,10 @@ onMounted(async () => {
505
509
  initInProcess = false;
506
510
  });
507
511
 
512
+ onUnmounted(() => {
513
+ clearAutoRefresher();
514
+ });
515
+
508
516
  watch([page], async () => {
509
517
  setQuery({ page: page.value });
510
518
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.177",
3
+ "version": "2.4.0-next.178",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",