Exclude initial page form history stack
In case the initial opened page had a "depth" of 2 or more, using the back button twice lead to the initial page to get opened again instead of decreasing the depth of the url. E.g. in case the reader was opened as the initial app page, closing the reader and then clicking the back button caused the reader to get opened again instead of going "back" to the library.
This commit is contained in:
@@ -13,7 +13,7 @@ export const useHistory = () => {
|
||||
const location = useLocation();
|
||||
const navigationType = useNavigationType();
|
||||
|
||||
const [history, setHistory] = useState<string[]>([location.pathname]);
|
||||
const [history, setHistory] = useState<string[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
const isLastPageInHistory = location.key === 'default';
|
||||
|
||||
Reference in New Issue
Block a user