Skip to content

Commit

Permalink
fix(insights): only show confirmation when navigating to new url (#24216
Browse files Browse the repository at this point in the history
)
  • Loading branch information
thmsobrmlr authored Aug 6, 2024
1 parent f676483 commit ce49493
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/scenes/insights/insightSceneLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ export const insightSceneLogic = kea<insightSceneLogicType>([
return false
}

// If just the hash changes, don't show the prompt
if (router.values.currentLocation.pathname === newLocation?.pathname) {
// If just the hash or project part changes, don't show the prompt
const currentPathname = router.values.currentLocation.pathname.replace(/\/project\/\d+/, '')
const newPathname = newLocation?.pathname.replace(/\/project\/\d+/, '')
if (currentPathname === newPathname) {
return false
}

Expand Down

0 comments on commit ce49493

Please sign in to comment.