From 5b3914535da56f9d142e81675182060c13a7eed7 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Fri, 7 Aug 2020 13:41:47 -0400 Subject: [PATCH] infrastructure: Replace m.deferred in Application with native promise functionality --- js/src/common/Application.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/js/src/common/Application.js b/js/src/common/Application.js index 9013185ea..51e2a480b 100644 --- a/js/src/common/Application.js +++ b/js/src/common/Application.js @@ -343,10 +343,8 @@ export default class Application { // Now make the request. If it's a failure, inspect the error that was // returned and show an alert containing its contents. - const deferred = m.deferred(); - - m.request(options).then( - (response) => deferred.resolve(response), + return m.request(options).then( + (response) => response, (error) => { let children; @@ -408,11 +406,9 @@ export default class Application { this.requestErrorAlert = this.alerts.show(error.alert); } - deferred.reject(error); + return Promise.reject(error); } ); - - return deferred.promise; } /**