Remove "default back to" functionality
Caused an infinite loop, because in case the Reader was the initial opened page, got closed and the back button was pressed, the Reader just got opened again. This happened because in case it was the initial opened page, closing the Reader did not use the browser back navigation and instead opened the Manga page, resulting in it to be pushed in the history stack with the Reader being the previous page
This commit is contained in:
@@ -13,7 +13,7 @@ import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||
export const useBackButton = () => {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const { history, defaultBackTo: backToUrl } = useContext(NavBarContext);
|
||||
const { history } = useContext(NavBarContext);
|
||||
|
||||
return () => {
|
||||
const isHistoryEmpty = !history.length;
|
||||
@@ -25,11 +25,6 @@ export const useBackButton = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (backToUrl) {
|
||||
navigate(backToUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
navigate('/library');
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user