From deaeff73cb6b300bdf337fb3c223ab48c59fe10c Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Thu, 2 May 2024 10:20:13 -0700 Subject: [PATCH] feat: sorts homepage every 10 seconds (#2929) --- assets/components/ContainerTable.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/assets/components/ContainerTable.vue b/assets/components/ContainerTable.vue index 58c4a6ed..b8b6b31f 100644 --- a/assets/components/ContainerTable.vue +++ b/assets/components/ContainerTable.vue @@ -116,13 +116,10 @@ const storage = useStorage<{ column: keys; direction: 1 | -1 }>("DOZZLE_TABLE_CO direction: -1, }); const { column: sortField, direction } = toRefs(storage); +const counter = useInterval(10000); const sortedContainers = computedWithControl( - () => [containers.length, sortField.value, direction.value], - () => { - return containers.sort((a, b) => { - return fields[sortField.value].sortFunc(a, b); - }); - }, + () => [containers.length, sortField.value, direction.value, counter.value], + () => containers.sort((a, b) => fields[sortField.value].sortFunc(a, b)), ); const totalPages = computed(() => Math.ceil(sortedContainers.value.length / perPage.value));