diff options
Diffstat (limited to 'front-end/src/store')
-rw-r--r-- | front-end/src/store/bookmarks.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/front-end/src/store/bookmarks.ts b/front-end/src/store/bookmarks.ts index a49937b..b6430f7 100644 --- a/front-end/src/store/bookmarks.ts +++ b/front-end/src/store/bookmarks.ts @@ -218,15 +218,17 @@ export const bookmarkPlugin = (bookmarkEndpoint: MaybeRef<string>): PiniaPlugin } //Update the total bookmarks - apiCall(async () => totalBookmarks.value = await bookmarkApi.count()) - apiCall(async () => allTags.value = await bookmarkApi.getTags()) + apiCall(async () => { + allTags.value = await bookmarkApi.getTags() + totalBookmarks.value = await bookmarkApi.count() + }) }) //Watch for serach query changes - watchDebounced([currentPage, currentPageSize, totalBookmarks, tags, query, allTags], - ([ page, pageSize, _, tags, query ]) => { + watchDebounced([currentPage, currentPageSize, tags, query, allTags], + ([ page, pageSize, tags, query ]) => { apiCall(async () => bookmarks.value = await bookmarkApi.list(page, pageSize, { tags, query })) - }, { debounce: 10 }) + }, { debounce: 50 }) //Watch for page changes and scroll to top watch([currentPage], () => window.scrollTo({ top: 0, behavior: 'smooth' })) |