fix some toast imports

This commit is contained in:
vitorsemeano 2020-10-18 14:19:41 +01:00
parent c7caf8134d
commit 4b42afcd7a
11 changed files with 38 additions and 59 deletions

View file

@ -6,6 +6,7 @@ import { appRouter } from './appRouter';
import itemHelper from './itemHelper';
import { playbackManager } from './playback/playbackmanager';
import ServerConnections from './ServerConnections';
import toast from './toast/toast';
/* eslint-disable indent */
export function getCommands(options) {
@ -373,9 +374,7 @@ import ServerConnections from './ServerConnections';
textArea.select();
if (document.execCommand('copy')) {
import('./toast/toast').then((toast) => {
toast(globalize.translate('CopyStreamURLSuccess'));
});
toast(globalize.translate('CopyStreamURLSuccess'));
} else {
prompt(globalize.translate('CopyStreamURL'), downloadHref);
}
@ -388,9 +387,7 @@ import ServerConnections from './ServerConnections';
} else {
/* eslint-disable-next-line compat/compat */
navigator.clipboard.writeText(downloadHref).then(function () {
import('./toast/toast').then((toast) => {
toast(globalize.translate('CopyStreamURLSuccess'));
});
toast(globalize.translate('CopyStreamURLSuccess'));
}).catch(function () {
textAreaCopy();
});