mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 08:57:35 +03:00
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.
This commit is contained in:
parent
e923847dac
commit
bc2f639aae
3 changed files with 4 additions and 4 deletions
|
@ -511,7 +511,7 @@ var RoomSubList = React.createClass({
|
||||||
if (list[i].tags[self.props.tagName] && list[i].tags[self.props.tagName].order === undefined) {
|
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() {
|
MatrixClientPeg.get().setRoomTag(list[i].roomId, self.props.tagName, {order: (order + 1.0) / 2.0}).finally(function() {
|
||||||
// Do any final stuff here
|
// Do any final stuff here
|
||||||
}).fail(function(err) {
|
}).catch(function(err) {
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
console.error("Failed to add tag " + self.props.tagName + " to room" + err);
|
console.error("Failed to add tag " + self.props.tagName + " to room" + err);
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
|
|
@ -68,7 +68,7 @@ module.exports = React.createClass({
|
||||||
if (self.props.onFinished) {
|
if (self.props.onFinished) {
|
||||||
self.props.onFinished();
|
self.props.onFinished();
|
||||||
};
|
};
|
||||||
}).fail(function(err) {
|
}).catch(function(err) {
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOff}),
|
title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOff}),
|
||||||
|
@ -85,7 +85,7 @@ module.exports = React.createClass({
|
||||||
if (self.props.onFinished) {
|
if (self.props.onFinished) {
|
||||||
self.props.onFinished();
|
self.props.onFinished();
|
||||||
};
|
};
|
||||||
}).fail(function(err) {
|
}).catch(function(err) {
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOn}),
|
title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOn}),
|
||||||
|
|
|
@ -111,7 +111,7 @@ var roomTileSource = {
|
||||||
//component.state.set({ spinner: component.state.spinner ? component.state.spinner++ : 1 });
|
//component.state.set({ spinner: component.state.spinner ? component.state.spinner++ : 1 });
|
||||||
MatrixClientPeg.get().deleteRoomTag(item.room.roomId, prevTag).finally(function() {
|
MatrixClientPeg.get().deleteRoomTag(item.room.roomId, prevTag).finally(function() {
|
||||||
//component.state.set({ spinner: component.state.spinner-- });
|
//component.state.set({ spinner: component.state.spinner-- });
|
||||||
}).fail(function(err) {
|
}).catch(function(err) {
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
console.error("Failed to remove tag " + prevTag + " from room: " + err);
|
console.error("Failed to remove tag " + prevTag + " from room: " + err);
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
|
Loading…
Reference in a new issue