1
0
Fork 0
mirror of https://github.com/VueTorrent/VueTorrent.git synced 2025-03-31 22:04:46 +03:00

fix(MagnetHandler): Don't show add dialog if not authenticated ()

This commit is contained in:
Rémi Marseault 2024-04-21 13:29:23 +02:00 committed by GitHub
parent 5384a2e1ed
commit a0cdffd380
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 7 deletions

View file

@ -111,7 +111,7 @@ watchEffect(() => {
<v-main>
<router-view />
</v-main>
<AddPanel />
<AddPanel v-if="authStore.isAuthenticated" />
<DnDZone />
</v-app>
</template>

View file

@ -6,14 +6,15 @@ import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
const router = useRouter()
const addTorrentStore = useAddTorrentStore()
const dialogStore = useDialogStore()
onBeforeMount(async () => {
const magnetLink = decodeURIComponent(route.params.url as string)
if (magnetLink.startsWith('magnet:')) {
const addTorrentStore = useAddTorrentStore()
addTorrentStore.isFirstInit = false
addTorrentStore.pushTorrentToQueue(magnetLink)
useDialogStore().createDialog(AddTorrentDialog, {})
dialogStore.createDialog(AddTorrentDialog, {})
}
await router.push({ name: 'dashboard' })
})

View file

@ -34,10 +34,7 @@ export const routes: RouteRecordRaw[] = [
{
name: 'magnetHandler',
path: '/magnet/:url',
component: () => import('./MagnetHandler.vue'),
meta: {
public: true
}
component: () => import('./MagnetHandler.vue')
},
{
name: 'login',