Skip to content

Commit 1b323dd

Browse files
committed
Merge #258: Fixes [257] unnecessary repetitive requests using the search bar
8cc222e fix: [257] unnecessary repetitive requests using the search bar (MMelchor) Pull request description: Fixes #257 Assigning the search query value to the variable used to fetch the searched torrents is now done through the onActivated hook, avoiding triggering the watchers, and thus, not making another unnecessary fetch request to the back-end, getting the torrents only once. ACKs for top commit: josecelano: ACK 8cc222e Tree-SHA512: ed1770d4f138c00e07dcd9a56792efa2de48ef4c4ab489b8f7e565b346153157465136e3c1542118513e529ba13b29e2c2a1c1fda07cc202107a4adf273d2e0c
2 parents 67a7bcd + 8cc222e commit 1b323dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pages/torrents.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ watch([searchQuery, itemsSorting, pageSize, currentPage, layout, categoryFilters
126126
loadTorrents();
127127
});
128128
129-
onMounted(() => {
129+
onActivated(() => {
130130
searchQuery.value = route.query.search as string ?? null;
131+
});
132+
133+
onMounted(() => {
131134
loadTorrents();
132135
});
133136

0 commit comments

Comments
 (0)