Skip to content

Commit

Permalink
Merge #258: Fixes [257] unnecessary repetitive requests using the sea…
Browse files Browse the repository at this point in the history
…rch 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
  • Loading branch information
josecelano committed Sep 14, 2023
2 parents 67a7bcd + 8cc222e commit 1b323dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/torrents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ watch([searchQuery, itemsSorting, pageSize, currentPage, layout, categoryFilters
loadTorrents();
});
onMounted(() => {
onActivated(() => {
searchQuery.value = route.query.search as string ?? null;
});
onMounted(() => {
loadTorrents();
});
Expand Down

0 comments on commit 1b323dd

Please sign in to comment.