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

If someone navigates directly to the Queue Page, they need a way to get back to search #18

Closed rgero closed 4 months ago

rgero commented 4 months ago

Currently if the user creates a brand new tab and goes directly to the Queue page, there is no history for them to go back to. So they need to have an actual redirect to the search page.

rgero commented 4 months ago

I'm solving this by using the "useLocation" hook from react-router-dom.

The logic for it is that if the key is "default" that means that there is no history. The user got to this page from an external place. As such, they need to be sent back to the search page directly rather than using the -1 value.