mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-08 21:38:43 +00:00
Added redirects for old url styles (#9780)
This commit is contained in:
parent
ba36ba0157
commit
cb4c6b3ca6
1 changed files with 26 additions and 0 deletions
|
|
@ -316,6 +316,32 @@ router.beforeEach(function routerGuard (to, from, next) {
|
|||
return next({name: 'tasks'});
|
||||
}
|
||||
|
||||
// Redirect old guild urls
|
||||
if (to.hash.indexOf('#/options/groups/guilds/') !== -1) {
|
||||
const splits = to.hash.split('/');
|
||||
const guildId = splits[4];
|
||||
|
||||
return next({
|
||||
name: 'guild',
|
||||
params: {
|
||||
groupId: guildId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Redirect old challenge urls
|
||||
if (to.hash.indexOf('#/options/groups/challenges/') !== -1) {
|
||||
const splits = to.hash.split('/');
|
||||
const challengeId = splits[4];
|
||||
|
||||
return next({
|
||||
name: 'challenge',
|
||||
params: {
|
||||
challengeId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Analytics.track({
|
||||
hitType: 'pageview',
|
||||
eventCategory: 'navigation',
|
||||
|
|
|
|||
Loading…
Reference in a new issue