Skip to content

Commit

Permalink
fix(project): don’t show copied text when using native share dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Jun 23, 2021
1 parent 7ba0599 commit 3bebd65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/screens/Movie/Movie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ const Movie = ({

if (typeof navigator.share === 'function') {
navigator.share({ title: item.title, text: item.description, url: window.location.href });
} else {
copyToClipboard(window.location.href);
return;
}

copyToClipboard(window.location.href);
setHasShared(true);
setTimeout(() => setHasShared(false), 2000);
};
Expand Down
5 changes: 3 additions & 2 deletions src/screens/Series/Series.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ const Series = ({

if (typeof navigator.share === 'function') {
navigator.share({ title: item.title, text: item.description, url: window.location.href });
} else {
copyToClipboard(window.location.href);
return;
}

copyToClipboard(window.location.href);
setHasShared(true);
setTimeout(() => setHasShared(false), 2000);
};
Expand Down

0 comments on commit 3bebd65

Please sign in to comment.