Fix navbar back button behavior (#195)
* Enable passing backLink through location state. Explicitly handle cases for BACK * Allow pages to override default backLink. Fix manga page back link * Cleanup
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
CircularProgress, IconButton, Stack, Tooltip,
|
||||
} from '@mui/material';
|
||||
import { Box } from '@mui/system';
|
||||
import NavbarContext from 'components/context/NavbarContext';
|
||||
import NavbarContext, { useSetDefaultBackTo } from 'components/context/NavbarContext';
|
||||
import ChapterList from 'components/manga/ChapterList';
|
||||
import { useRefreshManga } from 'components/manga/hooks';
|
||||
import MangaDetails from 'components/manga/MangaDetails';
|
||||
@@ -37,6 +37,8 @@ const Manga: React.FC = () => {
|
||||
|
||||
const [refresh, { loading: refreshing }] = useRefreshManga(id);
|
||||
|
||||
useSetDefaultBackTo(manga?.inLibrary === false && manga.sourceId != null ? `/sources/${manga.sourceId}/popular` : '/library');
|
||||
|
||||
useEffect(() => {
|
||||
// Automatically fetch manga from source if data is older then 24 hours
|
||||
// Automatic fetch is done only once, to prevent issues when server does
|
||||
|
||||
Reference in New Issue
Block a user