Handle the new /@<channel ID> URLs

This commit is contained in:
root
2023-01-28 05:09:16 +05:30
parent 1f9568e831
commit 6589f543e6
2 changed files with 20 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<template>
<v-progress-linear indeterminate />
</template>
<script>
export default {
name: 'NewChannelRedirect',
mounted () {
const { channelId } = this.$route.params
if (channelId.length === 0) {
this.$router.replace('/')
}
this.$router.replace('/c/@' + channelId)
}
}
</script>
+4
View File
@@ -58,6 +58,10 @@ const routes = [
name: 'Channel',
component: () => import('@/routes/Channel')
},
{
path: '/@:channelId',
component: () => import('@/components/NewChannelRedirect')
},
{
path: '/:videoId([a-zA-Z0-9_-]{11})',
component: () => import('@/components/Video/VideoRedirect')