Skip to content

Commit 6c72733

Browse files
author
MMelchor
committed
refactor: [#247] search bar not working when in /torrents endpoint
Code has been refactor and now looks cleaner and easier to understand.
1 parent e4d5fcd commit 6c72733

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

1212
<footer class="p-4 footer footer-center bg-base-300 text-base-content">

pages/torrents.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ const selectedSorting = computed({
106106
}
107107
});
108108
109-
watch([route], () => {
110-
if (route.query.search !== searchQuery.value) {
111-
searchQuery.value = route.query.search as string;
112-
}
109+
watch(() => route.fullPath, () => {
110+
searchQuery.value = route.query.search as string;
113111
});
114112
115113
watch([searchQuery, itemsSorting, pageSize, currentPage, layout, categoryFilters, tagFilters], () => {

0 commit comments

Comments
 (0)