Revert "s/.done(/.then(/ since modern es6 track unhandled promise exceptions"

This reverts commit 09a8fec2
This commit is contained in:
Michael Telatynski 2019-11-12 11:56:21 +00:00
parent 09a8fec261
commit 168b1b68bb
43 changed files with 72 additions and 74 deletions

View file

@ -97,7 +97,7 @@ module.exports = createReactClass({
phase: this.phases.LOADING,
});
MatrixClientPeg.get().setPushRuleEnabled('global', self.state.masterPushRule.kind, self.state.masterPushRule.rule_id, !checked).then(function() {
MatrixClientPeg.get().setPushRuleEnabled('global', self.state.masterPushRule.kind, self.state.masterPushRule.rule_id, !checked).done(function() {
self._refreshFromServer();
});
},
@ -170,7 +170,7 @@ module.exports = createReactClass({
emailPusher.kind = null;
emailPusherPromise = MatrixClientPeg.get().setPusher(emailPusher);
}
emailPusherPromise.then(() => {
emailPusherPromise.done(() => {
this._refreshFromServer();
}, (error) => {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
@ -274,7 +274,7 @@ module.exports = createReactClass({
}
}
Promise.all(deferreds).then(function() {
Promise.all(deferreds).done(function() {
self._refreshFromServer();
}, function(error) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
@ -343,7 +343,7 @@ module.exports = createReactClass({
}
}
Promise.all(deferreds).then(function(resps) {
Promise.all(deferreds).done(function(resps) {
self._refreshFromServer();
}, function(error) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
@ -398,7 +398,7 @@ module.exports = createReactClass({
};
// Then, add the new ones
Promise.all(removeDeferreds).then(function(resps) {
Promise.all(removeDeferreds).done(function(resps) {
const deferreds = [];
let pushRuleVectorStateKind = self.state.vectorContentRules.vectorState;
@ -434,7 +434,7 @@ module.exports = createReactClass({
}
}
Promise.all(deferreds).then(function(resps) {
Promise.all(deferreds).done(function(resps) {
self._refreshFromServer();
}, onError);
}, onError);
@ -650,7 +650,7 @@ module.exports = createReactClass({
externalContentRules: self.state.externalContentRules,
externalPushRules: self.state.externalPushRules,
});
}).then();
}).done();
MatrixClientPeg.get().getThreePids().then((r) => this.setState({threepids: r.threepids}));
},