mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 19:02:15 +00:00
refactor(Stream): simplify copyStreamLink function
This commit is contained in:
parent
d8fbd1855b
commit
619c620a88
1 changed files with 2 additions and 9 deletions
|
|
@ -117,8 +117,8 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
|
|||
const copyStreamLink = React.useCallback((event) => {
|
||||
event.preventDefault();
|
||||
closeMenu();
|
||||
if (streamLink && navigator?.clipboard) {
|
||||
navigator.clipboard.writeText(deepLinks.externalPlayer.download)
|
||||
if (streamLink) {
|
||||
navigator.clipboard.writeText(streamLink)
|
||||
.then(() => {
|
||||
toast.show({
|
||||
type: 'success',
|
||||
|
|
@ -133,13 +133,6 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
|
|||
timeout: 4000,
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
toast.show({
|
||||
type: 'error',
|
||||
title: t('PLAYER_COPY_STREAM_ERROR'),
|
||||
timeout: 4000,
|
||||
});
|
||||
}
|
||||
}, [streamLink]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue