rgero / Fajita

A custom YouTube wrapper designed to maintain a group video queue during gatherings, written in Typescript, utilizing React, MaterialUI, a custom backend, and websockets
0 stars 0 forks source link

Retain search results when navigating back from Queue #1

Closed rgero closed 5 months ago

rgero commented 5 months ago

This was requested by Tina and Vince. The idea is that they want to use the navigate buttons in the Queue Header and "Back to Search" action to return to the search page but retain the term they were searching before.

rgero commented 5 months ago

The change I'm making here is the following:

  const goBack = () => {
    // We want to go back to the Search Page
    // Ideally retaining what the person had searched before.
    navigate(-1);
  }

This should make it so that when the user clicks on the button, they get redirected back to the search page with their search term in the path. React Query will then look at their data, and should load those results. If the data is stale it'll refetch.