From cb4c6b3ca64024ced4d3259bb0001c6524fd92c0 Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Mon, 15 Jan 2018 12:43:02 -0700 Subject: [PATCH] Added redirects for old url styles (#9780) --- website/client/router.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/website/client/router.js b/website/client/router.js index 1df03797b8..8c55f3ae40 100644 --- a/website/client/router.js +++ b/website/client/router.js @@ -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',