Skip to content

Commit 03b715b

Browse files
committed
Add onRoomCreated callback to CreateRoom organism
1 parent a748c09 commit 03b715b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/controllers/organisms/CreateRoom.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ var React = require("react");
2020
var MatrixClientPeg = require("../../MatrixClientPeg");
2121

2222
module.exports = {
23+
propTypes: {
24+
onRoomCreated: React.PropTypes.func,
25+
},
26+
27+
getDefaultProps: function() {
28+
return {
29+
onRoomCreated: function() {},
30+
};
31+
},
32+
2333
onCreateRoom: function() {
2434
var options = {};
2535

@@ -46,5 +56,9 @@ module.exports = {
4656
}
4757

4858
var deferred = MatrixClientPeg.get().createRoom(options);
59+
60+
deferred.done(function () {
61+
this.props.onRoomCreated();
62+
});
4963
}
5064
};

0 commit comments

Comments
 (0)