Skip to content

Commit

Permalink
refactor: [#247] search bar not working when in /torrents endpoint
Browse files Browse the repository at this point in the history
Code has been refactor and now looks cleaner and easier to understand.
  • Loading branch information
MMelchor committed Sep 12, 2023
1 parent e4d5fcd commit 6c72733
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div class="flex flex-col w-full px-4 bg-base-300 md:px-8 lg:px-24">
<div class="flex flex-col my-6" style="max-width: 100vw;">
<NuxtPage :page-key="route => route.fullPath" />
<NuxtPage />
</div>

<footer class="p-4 footer footer-center bg-base-300 text-base-content">
Expand Down
6 changes: 2 additions & 4 deletions pages/torrents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ const selectedSorting = computed({
}
});
watch([route], () => {
if (route.query.search !== searchQuery.value) {
searchQuery.value = route.query.search as string;
}
watch(() => route.fullPath, () => {
searchQuery.value = route.query.search as string;
});
watch([searchQuery, itemsSorting, pageSize, currentPage, layout, categoryFilters, tagFilters], () => {
Expand Down

0 comments on commit 6c72733

Please sign in to comment.