Revert "Replace all trivial Promise.defer usages with regular Promises"

This reverts commit 44401d73
This commit is contained in:
Michael Telatynski 2019-11-12 11:56:53 +00:00
parent 7a512f7299
commit 548e38cba9
5 changed files with 138 additions and 122 deletions

View file

@ -312,14 +312,18 @@ async function _restoreFromLocalStorage(opts) {
function _handleLoadSessionFailure(e) {
console.error("Unable to load session", e);
const def = Promise.defer();
const SessionRestoreErrorDialog =
sdk.getComponent('views.dialogs.SessionRestoreErrorDialog');
const modal = Modal.createTrackedDialog('Session Restore Error', '', SessionRestoreErrorDialog, {
Modal.createTrackedDialog('Session Restore Error', '', SessionRestoreErrorDialog, {
error: e.message,
onFinished: (success) => {
def.resolve(success);
},
});
return modal.finished.then(([success]) => {
return def.promise.then((success) => {
if (success) {
// user clicked continue.
_clearStorage();