Fix/back button not working without browser history (#389)

* Introduce local history stack

To be able to know if the browser back navigation should be used, it is sometimes necessary to know which the previous page was.
E.g. it should not be used in case the current page is the manga page and the previous one is the reader.

* Handle cases where there is no previous page in the history stack

* Always use a button for the navigation back button

* Navigate from base route to library by replacing the current location

The base route should not be included in the history
This commit is contained in:
schroda
2023-06-26 20:40:35 +02:00
committed by GitHub
parent 1d76e990ae
commit 09b10cd5ab
11 changed files with 83 additions and 12 deletions

View File

@@ -49,7 +49,7 @@ const App: React.FC = () => (
>
<Routes>
{/* General Routes */}
<Route path="/" element={<Navigate to="/library" />} />
<Route path="/" element={<Navigate to="/library" replace />} />
<Route path="settings">
<Route index element={<Settings />} />
<Route path="about" element={<About />} />