Skip to content

Commit

Permalink
changed priority of backUrl and history for back button in pageTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 committed Sep 8, 2023
1 parent fb4e7be commit 4c0835f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Common/hooks/useAppHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ export default function useAppHistory() {
const resetHistory = useContext(ResetHistoryContext);

const goBack = (fallbackUrl?: string) => {
if (history.length > 1)
// Navigate to history present in the app navigation history stack.
return navigate(history[1]);

if (fallbackUrl)
// Otherwise, use provided fallback url if provided.
// use provided fallback url if provided.
return navigate(fallbackUrl);

if (history.length > 1)
// Otherwise, navigate to history present in the app navigation history stack.
return navigate(history[1]);
// Otherwise, fallback to browser's go back behaviour.
window.history.back();
};
Expand Down

0 comments on commit 4c0835f

Please sign in to comment.