Skip to content

Commit

Permalink
Fix issue where session start on edit post page goes to new post page
Browse files Browse the repository at this point in the history
  • Loading branch information
0xi4o committed Aug 28, 2024
1 parent 694657a commit 0b31727
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/editor/writing-session-timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ const WritingSessionTimer = ({
if (splashOpen) {
handleSplashOpen(false)
}
if (location.pathname !== ROUTES.EDITOR.POST) {
if (
!location.pathname.startsWith(ROUTES.EDITOR.POST) ||
(location.pathname.startsWith(ROUTES.EDITOR.POST) &&
location.pathname.replace(ROUTES.EDITOR.POST, '') === '')
) {
navigate(ROUTES.EDITOR.POST)
}
}
Expand Down

0 comments on commit 0b31727

Please sign in to comment.