feat(profiles): load modal instead of page?

This commit is contained in:
SabreCat
2023-09-11 22:53:14 -05:00
parent 9986082914
commit ec85159c65
+9 -1
View File
@@ -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,