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 (#1657)
This commit is contained in:
parent
5384a2e1ed
commit
a0cdffd380
3 changed files with 5 additions and 7 deletions
src
|
@ -111,7 +111,7 @@ watchEffect(() => {
|
|||
<v-main>
|
||||
<router-view />
|
||||
</v-main>
|
||||
<AddPanel />
|
||||
<AddPanel v-if="authStore.isAuthenticated" />
|
||||
<DnDZone />
|
||||
</v-app>
|
||||
</template>
|
||||
|
|
|
@ -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' })
|
||||
})
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue