Skip to content

Commit

Permalink
fix the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SebinSong committed Feb 4, 2024
1 parent 36b7b59 commit 57ecc78
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frontend/views/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,20 @@ export default ({
sbp('okTurtles.events/emit', OPEN_MODAL, mode)
},
navigateToGroupPage () {
this.$router.push({ path: this.ourGroupProfile ? '/dashboard' : '/pending-approval' }).catch(console.warn)
this.$router.push({
// NOTE:
// When browser refresh is triggered, there is an issue that Vue router prematurely decides ('loginGuard' there) that
// the user is not signed in when in actual reality user-login is still being processed and then
// takes user to 'Home.vue' with the '$route.query.next' being set to the initial url.
// In this particular condition, the app needs to immediately redirect user to '$route.query.next'
// so that the user stays in the same page after the browser refresh.
// (Related GH issue: https://github.com/okTurtles/group-income/issues/1830)
path: this.$route.query.next ?? (
this.ourGroupProfile
? '/dashboard'
: '/pending-approval'
)
}).catch(console.warn)
}
},
watch: {
Expand Down

0 comments on commit 57ecc78

Please sign in to comment.