diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 67a440f..ebeeb4a 100644 --- a/client/src/app/navbar/navbar.component.html +++ b/client/src/app/navbar/navbar.component.html @@ -37,13 +37,7 @@ Settings - - - - - - Register Magnet Handler - + diff --git a/client/src/app/navbar/navbar.component.ts b/client/src/app/navbar/navbar.component.ts index fb37c6e..92e596b 100644 --- a/client/src/app/navbar/navbar.component.ts +++ b/client/src/app/navbar/navbar.component.ts @@ -57,22 +57,6 @@ export class NavbarComponent implements OnInit { }); } - public registerMagnetHandler(): void { - if (window.location.protocol !== "https:") { - alert("Magnet link registration requires a secure connection. Please ensure your site is being served over HTTPS to enable this feature."); - return; - } - - const handlerUrl = `${window.location.origin}/add?magnet=%s`; - - if (navigator.registerProtocolHandler) { - navigator.registerProtocolHandler("magnet", handlerUrl); - alert("Your browser will display a prompt asking if you'd like to add the client as the default application for magnet links. Please confirm to complete the setup."); - } else { - alert("Magnet link registration failed. Your browser does not support registering custom protocol handlers."); - } - } - public logout(): void { this.authService.logout().subscribe( () => { diff --git a/client/src/app/settings/settings.component.html b/client/src/app/settings/settings.component.html index e10d21b..287c23c 100644 --- a/client/src/app/settings/settings.component.html +++ b/client/src/app/settings/settings.component.html @@ -141,6 +141,16 @@ + + Allow client to handle magnet links + + + Register Handler + + + This will register the client as your browser's default handler for magnet links. Clicking a magnet link will automatically open it in the new torrent screen for downloading. + + diff --git a/client/src/app/settings/settings.component.ts b/client/src/app/settings/settings.component.ts index 91ba58b..4f71f5e 100644 --- a/client/src/app/settings/settings.component.ts +++ b/client/src/app/settings/settings.component.ts @@ -139,4 +139,20 @@ export class SettingsComponent implements OnInit { }, ); } + + public registerMagnetHandler(): void { + if (window.location.protocol !== "https:") { + alert("Magnet link handler registration requires a secure connection. Please ensure the client is being served over HTTPS to enable this feature."); + return; + } + + const handlerUrl = `${window.location.origin}/add?magnet=%s`; + + if (navigator.registerProtocolHandler) { + navigator.registerProtocolHandler("magnet", handlerUrl); + alert("Your browser will display a prompt asking if you'd like to add the client as the default application for magnet links. Please confirm to complete the setup."); + } else { + alert("Magnet link registration failed. Your browser does not support registering custom protocol handlers."); + } + } }
This will register the client as your browser's default handler for magnet links. Clicking a magnet link will automatically open it in the new torrent screen for downloading.