fix: magnet handling (#1041)

This commit is contained in:
Jagadam Dinesh Reddy 2023-08-15 15:47:36 +05:30 committed by GitHub
parent 232b9319ec
commit c57da2d95a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -41,8 +41,7 @@ const router = new Router({
{
path: '/download=:magnet',
name: 'MagnetHandler',
component: () => import('./views/MagnetHandler.vue'),
props: true
component: () => import('./views/MagnetHandler.vue')
},
{
path: '/login',

View file

@ -7,9 +7,9 @@ import { General } from '@/mixins'
export default {
name: 'MagnetHandler',
mixins: [General],
props: ['magnet'],
created() {
this.createModal('AddModal', { initialMagnet: this.magnet })
const regex = new RegExp('^\/download\=(.+?)(?:\/(?=$))?$', 'is')
this.createModal('AddModal', { initialMagnet: regex.exec(this.$route.fullPath)[1] })
this.$router.push({ name: 'dashboard' })
}
}