From bc2f639aaecdb655756fe5aa47e853eed7e43989 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 24 Jul 2017 17:19:46 +0100 Subject: [PATCH] Fix a couple of minor errors in the room list bluebird promises don't support .fail, so some operations didn't work quite right. We should use .catch instead. --- src/components/structures/RoomSubList.js | 2 +- src/components/views/context_menus/RoomTileContextMenu.js | 4 ++-- src/components/views/rooms/DNDRoomTile.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 17febe02c7..4844f0ed35 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -511,7 +511,7 @@ var RoomSubList = React.createClass({ if (list[i].tags[self.props.tagName] && list[i].tags[self.props.tagName].order === undefined) { MatrixClientPeg.get().setRoomTag(list[i].roomId, self.props.tagName, {order: (order + 1.0) / 2.0}).finally(function() { // Do any final stuff here - }).fail(function(err) { + }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + self.props.tagName + " to room" + err); Modal.createDialog(ErrorDialog, { diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index 4d08e8332e..3ef0646237 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -68,7 +68,7 @@ module.exports = React.createClass({ if (self.props.onFinished) { self.props.onFinished(); }; - }).fail(function(err) { + }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOff}), @@ -85,7 +85,7 @@ module.exports = React.createClass({ if (self.props.onFinished) { self.props.onFinished(); }; - }).fail(function(err) { + }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOn}), diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js index 2f521028cd..cd5e54f071 100644 --- a/src/components/views/rooms/DNDRoomTile.js +++ b/src/components/views/rooms/DNDRoomTile.js @@ -111,7 +111,7 @@ var roomTileSource = { //component.state.set({ spinner: component.state.spinner ? component.state.spinner++ : 1 }); MatrixClientPeg.get().deleteRoomTag(item.room.roomId, prevTag).finally(function() { //component.state.set({ spinner: component.state.spinner-- }); - }).fail(function(err) { + }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to remove tag " + prevTag + " from room: " + err); Modal.createDialog(ErrorDialog, {