1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

solved imports for alert, toast and confirm

This commit is contained in:
vitorsemeano 2020-10-18 15:18:15 +01:00
parent 4b42afcd7a
commit 86a9f4e36f
49 changed files with 417 additions and 550 deletions

View file

@ -18,6 +18,7 @@ import '../formdialog.css';
import '../../elements/emby-toggle/emby-toggle';
import '../../assets/css/flexstyles.css';
import toast from '../toast/toast';
import confirm from '../confirm/confirm';
function onEditLibrary() {
if (isCreating) {
@ -69,20 +70,18 @@ import toast from '../toast/toast';
const button = btnRemovePath;
const virtualFolder = currentOptions.library;
import('../confirm/confirm').then(({default: confirm}) => {
confirm({
title: globalize.translate('HeaderRemoveMediaLocation'),
text: globalize.translate('MessageConfirmRemoveMediaLocation'),
confirmText: globalize.translate('Delete'),
primary: 'delete'
}).then(() => {
const refreshAfterChange = currentOptions.refresh;
ApiClient.removeMediaPath(virtualFolder.Name, location, refreshAfterChange).then(() => {
hasChanges = true;
refreshLibraryFromServer(dom.parentWithClass(button, 'dlg-libraryeditor'));
}, () => {
toast(globalize.translate('ErrorDefault'));
});
confirm({
title: globalize.translate('HeaderRemoveMediaLocation'),
text: globalize.translate('MessageConfirmRemoveMediaLocation'),
confirmText: globalize.translate('Delete'),
primary: 'delete'
}).then(() => {
const refreshAfterChange = currentOptions.refresh;
ApiClient.removeMediaPath(virtualFolder.Name, location, refreshAfterChange).then(() => {
hasChanges = true;
refreshLibraryFromServer(dom.parentWithClass(button, 'dlg-libraryeditor'));
}, () => {
toast(globalize.translate('ErrorDefault'));
});
});
}