Showing toast when copying stream URL fails

This commit is contained in:
Thibault Nocchi 2020-01-30 21:08:01 +01:00
parent f2c24921e1
commit 16c75e9e5e
2 changed files with 6 additions and 4 deletions

View File

@ -351,14 +351,15 @@ define(["apphost", "globalize", "connectionManager", "itemHelper", "appRouter",
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand("copy");
if (document.execCommand("copy")) {
require(["toast"], function (toast) {
toast(globalize.translate("CopyStreamURLSuccess"));
});
} catch (err) {
} else {
console.error("Failed to copy to clipboard");
require(["toast"], function (toast) {
toast(globalize.translate("CopyStreamURLError"));
});
}
document.body.removeChild(textArea);

View File

@ -161,6 +161,7 @@
"Continuing": "Continuing",
"CopyStreamURL": "Copy Stream URL",
"CopyStreamURLSuccess": "URL copied successfully.",
"CopyStreamURLError": "There was an error copying the URL.",
"CriticRating": "Critic rating",
"CustomDlnaProfilesHelp": "Create a custom profile to target a new device or override a system profile.",
"DateAdded": "Date added",