mirror of
https://github.com/zoriya/flood.git
synced 2026-06-06 20:12:19 +00:00
AddTorrentsByURL: display "handle magnet link" only when supported
This commit is contained in:
@@ -41,21 +41,23 @@ const AddTorrentsByURL: FC = () => {
|
||||
{intl.formatMessage({
|
||||
id: 'torrents.add.torrents.label',
|
||||
})}
|
||||
<em
|
||||
style={{cursor: 'pointer', fontSize: '0.8em', float: 'right'}}
|
||||
onClick={() => {
|
||||
if (typeof navigator.registerProtocolHandler === 'function') {
|
||||
navigator.registerProtocolHandler(
|
||||
'magnet',
|
||||
`${ConfigStore.baseURI}?action=add-urls&url=%s`,
|
||||
'Magnet -> Flood',
|
||||
);
|
||||
}
|
||||
}}>
|
||||
{intl.formatMessage({
|
||||
id: 'torrents.add.tab.url.register.magnet.handler',
|
||||
})}
|
||||
</em>
|
||||
{typeof navigator.registerProtocolHandler === 'function' && (
|
||||
<em
|
||||
style={{cursor: 'pointer', fontSize: '0.8em', float: 'right'}}
|
||||
onClick={() => {
|
||||
if (typeof navigator.registerProtocolHandler === 'function') {
|
||||
navigator.registerProtocolHandler(
|
||||
'magnet',
|
||||
`${ConfigStore.baseURI}?action=add-urls&url=%s`,
|
||||
'Magnet -> Flood',
|
||||
);
|
||||
}
|
||||
}}>
|
||||
{intl.formatMessage({
|
||||
id: 'torrents.add.tab.url.register.magnet.handler',
|
||||
})}
|
||||
</em>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
placeholder={intl.formatMessage({
|
||||
|
||||
Reference in New Issue
Block a user