mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
fix some unhandled promises and refactor some code
This commit is contained in:
parent
d7161f9d65
commit
df599db415
@ -33,14 +33,7 @@ import globalize from '../scripts/globalize';
|
||||
});
|
||||
|
||||
options.buttons = items;
|
||||
|
||||
return dialog.show(options).then(function (result) {
|
||||
if (result === 'ok') {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return Promise.reject();
|
||||
});
|
||||
return dialog.show(options);
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
|
@ -106,15 +106,6 @@ import '../../assets/css/scrollstyles.css';
|
||||
tryRemoveElement(dlg);
|
||||
}
|
||||
}
|
||||
|
||||
//resolve();
|
||||
// if we just called history.back(), then use a timeout to allow the history events to fire first
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
element: dlg,
|
||||
closedByBack: self.closedByBack
|
||||
});
|
||||
}, 1);
|
||||
}
|
||||
|
||||
dlg.addEventListener('close', onDialogClosed);
|
||||
@ -265,6 +256,7 @@ import '../../assets/css/scrollstyles.css';
|
||||
dom.addEventListener(dlg, dom.whichAnimationEvent(), onFinish, {
|
||||
once: true
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -319,6 +319,7 @@ import confirm from '../confirm/confirm';
|
||||
alert({
|
||||
text: globalize.translate('PleaseSelectTwoItems')
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ import '../../elements/emby-input/emby-input';
|
||||
import '../formdialog.css';
|
||||
import template from './prompt.template.html';
|
||||
|
||||
/* eslint-disable indent */
|
||||
export default (() => {
|
||||
function replaceAll(str, find, replace) {
|
||||
return str.split(find).join(replace);
|
||||
@ -127,4 +126,3 @@ export default (() => {
|
||||
};
|
||||
}
|
||||
})();
|
||||
/* eslint-enable indent */
|
||||
|
@ -112,7 +112,7 @@ export default function (page, providerId, options) {
|
||||
providerId = result.Id;
|
||||
reload();
|
||||
}, function () {
|
||||
Dashboard.alert({ // ApiClient.ajax() error handler
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
@ -102,9 +102,9 @@ import confirm from '../../components/confirm/confirm';
|
||||
case 'sendmessage':
|
||||
showSendMessageForm(btn, session);
|
||||
break;
|
||||
|
||||
case 'transcodinginfo':
|
||||
showPlaybackInfo(btn, session);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -31,6 +31,7 @@ export const activate = () => {
|
||||
title: globalize.translate('HeaderError'),
|
||||
message: globalize.translate('DefaultErrorMessage')
|
||||
});
|
||||
|
||||
throw e;
|
||||
});
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ function showMessage(text, userSettingsKey, appHostFeature) {
|
||||
}
|
||||
|
||||
userSettings.set(userSettingsKey, '1', false);
|
||||
return alert(text).catch(() => { /* ignore exceptions */ });
|
||||
return alert(text);
|
||||
}
|
||||
|
||||
function showBlurayMessage() {
|
||||
|
@ -65,7 +65,7 @@ export async function serverAddress() {
|
||||
}));
|
||||
}).then(configs => {
|
||||
const selection = configs.find(obj => !obj.config.StartupWizardCompleted) || configs[0];
|
||||
return Promise.resolve(selection.url);
|
||||
return Promise.resolve(selection?.url);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
return Promise.resolve();
|
||||
|
Loading…
Reference in New Issue
Block a user