Skip to content

Commit

Permalink
fix(MagnetHandler): Don't show add dialog if not authenticated (#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsluph committed Apr 21, 2024
1 parent 5384a2e commit a0cdffd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Expand Up @@ -111,7 +111,7 @@ watchEffect(() => {
<v-main>
<router-view />
</v-main>
<AddPanel />
<AddPanel v-if="authStore.isAuthenticated" />
<DnDZone />
</v-app>
</template>
5 changes: 3 additions & 2 deletions src/pages/MagnetHandler.vue
Expand Up @@ -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' })
})
Expand Down
5 changes: 1 addition & 4 deletions src/pages/index.ts
Expand Up @@ -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',
Expand Down

0 comments on commit a0cdffd

Please sign in to comment.