mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
fix: handle edge case noticed by @vbelolapotkov
This commit is contained in:
parent
08e73747bd
commit
24b2cab473
@ -1,7 +1,10 @@
|
||||
export default function(to, from, savedPosition) {
|
||||
let position = { x: 0, y: 0 }
|
||||
if (savedPosition) {
|
||||
position = savedPosition
|
||||
}
|
||||
return position
|
||||
if (savedPosition) return savedPosition
|
||||
|
||||
// Edge case: If you click on a notification from a comment and then on the
|
||||
// post page you click on 'comments', we avoid a "jumping" scroll behavior,
|
||||
// ie. jump to the top and scroll back from there
|
||||
if (to.path === from.path && to.hash !== from.hash) return false
|
||||
|
||||
return { x: 0, y: 0 }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user