mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Don't switch rooms when forgetting a room (#3275)
Don't randomly change to another room upon forgetting a room.
This commit is contained in:
parent
98c0232a96
commit
f80cbebb9d
@ -30,6 +30,7 @@ import * as Rooms from '../../../Rooms';
|
|||||||
import * as RoomNotifs from '../../../RoomNotifs';
|
import * as RoomNotifs from '../../../RoomNotifs';
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
import RoomListActions from '../../../actions/RoomListActions';
|
import RoomListActions from '../../../actions/RoomListActions';
|
||||||
|
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'RoomTileContextMenu',
|
displayName: 'RoomTileContextMenu',
|
||||||
@ -158,8 +159,12 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
_onClickForget: function() {
|
_onClickForget: function() {
|
||||||
// FIXME: duplicated with RoomSettings (and dead code in RoomView)
|
// FIXME: duplicated with RoomSettings (and dead code in RoomView)
|
||||||
MatrixClientPeg.get().forget(this.props.room.roomId).done(function() {
|
MatrixClientPeg.get().forget(this.props.room.roomId).done(() => {
|
||||||
dis.dispatch({ action: 'view_next_room' });
|
// Switch to another room view if we're currently viewing the
|
||||||
|
// historical room
|
||||||
|
if (RoomViewStore.getRoomId() === this.props.room.roomId) {
|
||||||
|
dis.dispatch({ action: 'view_next_room' });
|
||||||
|
}
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
const errCode = err.errcode || _td("unknown error code");
|
const errCode = err.errcode || _td("unknown error code");
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
|
Loading…
Reference in New Issue
Block a user