From 1e0d6654bc8189d853ccff5995ffd577c18ebb50 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 7 Mar 2024 18:59:10 -0600 Subject: [PATCH] fix bug where reloading `ToolsList` would show nothing If you reloaded `ToolsList` with no filters, instead of showing the entire toolset, it would show no results. This was because `itemsLoaded` needed to be a reactive computed value instead of a ref. --- client/src/components/ToolsList/ToolsList.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/components/ToolsList/ToolsList.vue b/client/src/components/ToolsList/ToolsList.vue index 319f27c5809b..14277d065892 100644 --- a/client/src/components/ToolsList/ToolsList.vue +++ b/client/src/components/ToolsList/ToolsList.vue @@ -60,15 +60,14 @@ const filterSettings = computed(() => { return newFilterSettings; }); -const itemsLoaded: Ref = ref([]); - onMounted(async () => { await toolStore.fetchTools(filterSettings.value); - itemsLoaded.value = Object.values(toolStore.getToolsById(filterSettings.value)); }); const filterCount = computed(() => Object.keys(filterSettings.value).length); +const itemsLoaded = computed(() => Object.values(toolStore.getToolsById(filterSettings.value))); + function scrollToTop() { scrollContainer.value?.scrollTo({ top: 0, behavior: "smooth" }); }