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:
@@ -9,6 +9,7 @@ import React from 'react';
|
||||
import { Fab } from '@mui/material';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { PlayArrow } from '@mui/icons-material';
|
||||
import { BACK } from 'util/useBackTo';
|
||||
|
||||
interface ResumeFABProps{
|
||||
chapter: IChapter
|
||||
@@ -23,7 +24,7 @@ export default function ResumeFab(props: ResumeFABProps) {
|
||||
component={Link}
|
||||
variant="extended"
|
||||
color="primary"
|
||||
to={`/manga/${mangaId}/chapter/${index}/page/${lastPageRead}`}
|
||||
to={{ pathname: `/manga/${mangaId}/chapter/${index}/page/${lastPageRead}`, state: { backLink: BACK } }}
|
||||
>
|
||||
<PlayArrow />
|
||||
{index === 1 ? 'Start' : 'Resume' }
|
||||
|
||||
Reference in New Issue
Block a user