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

This commit is contained in:
Michael Telatynski 2019-11-12 11:51:23 +00:00
parent 0a21957b2c
commit 09a8fec261
43 changed files with 74 additions and 72 deletions

View file

@ -1101,7 +1101,7 @@ module.exports = createReactClass({
}
ContentMessages.sharedInstance().sendStickerContentToRoom(url, this.state.room.roomId, info, text, MatrixClientPeg.get())
.done(undefined, (error) => {
.then(undefined, (error) => {
if (error.name === "UnknownDeviceError") {
// Let the staus bar handle this
return;
@ -1145,7 +1145,7 @@ module.exports = createReactClass({
filter: filter,
term: term,
});
this._handleSearchResult(searchPromise).done();
this._handleSearchResult(searchPromise).then();
},
_handleSearchResult: function(searchPromise) {
@ -1316,7 +1316,7 @@ module.exports = createReactClass({
},
onForgetClick: function() {
MatrixClientPeg.get().forget(this.state.room.roomId).done(function() {
MatrixClientPeg.get().forget(this.state.room.roomId).then(function() {
dis.dispatch({ action: 'view_next_room' });
}, function(err) {
const errCode = err.errcode || _t("unknown error code");
@ -1333,7 +1333,7 @@ module.exports = createReactClass({
this.setState({
rejecting: true,
});
MatrixClientPeg.get().leave(this.state.roomId).done(function() {
MatrixClientPeg.get().leave(this.state.roomId).then(function() {
dis.dispatch({ action: 'view_next_room' });
self.setState({
rejecting: false,