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:
@@ -24,7 +24,7 @@ import { ICategory, IncludeInGlobalUpdate } from '@/typings';
|
||||
import requestManager from '@/lib/RequestManager';
|
||||
import makeToast from '@/components/util/Toast';
|
||||
import ThreeStateCheckboxInput from '@/components/atoms/ThreeStateCheckboxInput';
|
||||
import NavbarContext from '@/components/context/NavbarContext';
|
||||
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
|
||||
import SearchSettings from '@/screens/settings/SearchSettings';
|
||||
|
||||
const CategoriesDiv = styled('div')({
|
||||
@@ -78,6 +78,8 @@ export default function LibrarySettings() {
|
||||
setAction(null);
|
||||
}, [t]);
|
||||
|
||||
useSetDefaultBackTo('settings');
|
||||
|
||||
const { data: categories = [], error: requestError, mutate } = requestManager.useGetCategories();
|
||||
const [dialogCategories, setDialogCategories] = useState<ICategory[]>(categories);
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user