Use global navigation history stack
The readers history stack was different to the one from the rest of the app, resulting in an infinite loop when using the closing the reader and using the back button in the manga page, since the back button just opened the reader again.
Regression introduced with 4bb458778e
This commit is contained in:
@@ -8,14 +8,12 @@
|
||||
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useContext } from 'react';
|
||||
import { useHistory } from '@/util/useHistory.ts';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||
|
||||
export const useBackButton = () => {
|
||||
const navigate = useNavigate();
|
||||
const history = useHistory();
|
||||
const location = useLocation();
|
||||
const { defaultBackTo: backToUrl } = useContext(NavBarContext);
|
||||
const { history, defaultBackTo: backToUrl } = useContext(NavBarContext);
|
||||
|
||||
return () => {
|
||||
const isHistoryEmpty = !history.length;
|
||||
|
||||
Reference in New Issue
Block a user