mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-04-06 08:43:51 +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>
|
<v-main>
|
||||||
<router-view />
|
<router-view />
|
||||||
</v-main>
|
</v-main>
|
||||||
<AddPanel />
|
<AddPanel v-if="authStore.isAuthenticated" />
|
||||||
<DnDZone />
|
<DnDZone />
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -6,14 +6,15 @@ import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const addTorrentStore = useAddTorrentStore()
|
||||||
|
const dialogStore = useDialogStore()
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
const magnetLink = decodeURIComponent(route.params.url as string)
|
const magnetLink = decodeURIComponent(route.params.url as string)
|
||||||
if (magnetLink.startsWith('magnet:')) {
|
if (magnetLink.startsWith('magnet:')) {
|
||||||
const addTorrentStore = useAddTorrentStore()
|
|
||||||
addTorrentStore.isFirstInit = false
|
addTorrentStore.isFirstInit = false
|
||||||
addTorrentStore.pushTorrentToQueue(magnetLink)
|
addTorrentStore.pushTorrentToQueue(magnetLink)
|
||||||
useDialogStore().createDialog(AddTorrentDialog, {})
|
dialogStore.createDialog(AddTorrentDialog, {})
|
||||||
}
|
}
|
||||||
await router.push({ name: 'dashboard' })
|
await router.push({ name: 'dashboard' })
|
||||||
})
|
})
|
||||||
|
|
|
@ -34,10 +34,7 @@ export const routes: RouteRecordRaw[] = [
|
||||||
{
|
{
|
||||||
name: 'magnetHandler',
|
name: 'magnetHandler',
|
||||||
path: '/magnet/:url',
|
path: '/magnet/:url',
|
||||||
component: () => import('./MagnetHandler.vue'),
|
component: () => import('./MagnetHandler.vue')
|
||||||
meta: {
|
|
||||||
public: true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'login',
|
name: 'login',
|
||||||
|
|
Loading…
Add table
Reference in a new issue