Show Loader while leaving
This commit is contained in:
parent
b9fd174f72
commit
ed1cb44deb
|
@ -56,5 +56,7 @@ module.exports = {
|
||||||
);
|
);
|
||||||
|
|
||||||
React.render(dialog, this.getOrCreateContainer());
|
React.render(dialog, this.getOrCreateContainer());
|
||||||
|
|
||||||
|
return {close: closeDialog};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,8 @@ limitations under the License.
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var dis = require("../../dispatcher");
|
var dis = require("../../dispatcher");
|
||||||
|
var Modal = require("../../Modal");
|
||||||
|
var Loader = require("react-loader");
|
||||||
|
|
||||||
var MatrixClientPeg = require("../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||||
|
|
||||||
|
@ -30,12 +32,14 @@ module.exports = {
|
||||||
|
|
||||||
onLeaveClick: function() {
|
onLeaveClick: function() {
|
||||||
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
|
var d = MatrixClientPeg.get().leave(this.props.member.roomId);
|
||||||
// TODO: Add spinner
|
|
||||||
|
var modal = Modal.createDialog(Loader);
|
||||||
|
|
||||||
d.then(function() {
|
d.then(function() {
|
||||||
// TODO: Change to another room.
|
modal.close();
|
||||||
dis.dispatch({action: 'view_next_room'});
|
dis.dispatch({action: 'view_next_room'});
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
|
modal.close();
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: "Failed to leave room",
|
title: "Failed to leave room",
|
||||||
description: err.toString()
|
description: err.toString()
|
||||||
|
|
Loading…
Reference in New Issue