diff --git a/website/client/src/router/index.js b/website/client/src/router/index.js index ea8cceb6e9..dca120ebb6 100644 --- a/website/client/src/router/index.js +++ b/website/client/src/router/index.js @@ -319,11 +319,19 @@ router.beforeEach(async (to, from, next) => { }); } - if ((to.name === 'userProfile' || to.name === 'userProfilePage') && from.name !== null) { + if ((to.name === 'userProfile' || to.name === 'userProfilePage')) { let startingPage = 'profile'; if (to.params.startingPage !== undefined) { startingPage = to.params.startingPage; } + if (from.name === null) { + setTimeout(() => router.app.$emit('habitica:show-profile', { + userId: to.params.userId, + startingPage, + path: to.path, + }), 500); + return next({ name: 'tasks' }); + } router.app.$emit('habitica:show-profile', { userId: to.params.userId, startingPage,