Skip to content

Commit

Permalink
fix bug where reloading ToolsList would show nothing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahmedhamidawan committed Mar 8, 2024
1 parent 07deeff commit 1e0d665
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/src/components/ToolsList/ToolsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ const filterSettings = computed(() => {
return newFilterSettings;
});
const itemsLoaded: Ref<Tool[]> = 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<Tool[]>(() => Object.values(toolStore.getToolsById(filterSettings.value)));
function scrollToTop() {
scrollContainer.value?.scrollTo({ top: 0, behavior: "smooth" });
}
Expand Down

0 comments on commit 1e0d665

Please sign in to comment.