From 03b715b8bfff3a77f00a2a645d2da9e7bd37ccf1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 14 Jul 2015 17:01:06 +0100 Subject: [PATCH] Add onRoomCreated callback to CreateRoom organism --- src/controllers/organisms/CreateRoom.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/controllers/organisms/CreateRoom.js b/src/controllers/organisms/CreateRoom.js index d97f2493..499585b0 100644 --- a/src/controllers/organisms/CreateRoom.js +++ b/src/controllers/organisms/CreateRoom.js @@ -20,6 +20,16 @@ var React = require("react"); var MatrixClientPeg = require("../../MatrixClientPeg"); module.exports = { + propTypes: { + onRoomCreated: React.PropTypes.func, + }, + + getDefaultProps: function() { + return { + onRoomCreated: function() {}, + }; + }, + onCreateRoom: function() { var options = {}; @@ -46,5 +56,9 @@ module.exports = { } var deferred = MatrixClientPeg.get().createRoom(options); + + deferred.done(function () { + this.props.onRoomCreated(); + }); } };