{
+ dis.dispatch({action: 'message_sent'});
+ }, (err) => {
+ if (err.name === "UnknownDeviceError") {
+ dis.dispatch({
+ action: 'unknown_device_error',
+ err: err,
+ room: Client.getRoom(payload.room_id),
+ });
+ }
+ dis.dispatch({action: 'message_send_failed'});
+ });
+ if (this.props.currentRoomId === payload.room_id) this.props.onCancelClick();
+ }
+ },
+
+ _onKeyDown: function(ev) {
+ switch (ev.keyCode) {
+ case KeyCode.ESCAPE:
+ this.props.onCancelClick();
+ break;
+ }
+ },
+
+ render: function() {
+ return (
+
+
Please select the destination room for this message
+
+ );
+ },
+});
diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js
index 3463ef948f..0ef69daba3 100644
--- a/src/components/views/rooms/RoomHeader.js
+++ b/src/components/views/rooms/RoomHeader.js
@@ -189,6 +189,9 @@ module.exports = React.createClass({
);
save_button = Save;
+ }
+
+ if (this.props.onCancelClick) {
cancel_button = ;
}
diff --git a/src/dispatcher.js b/src/dispatcher.js
index 9864cb3807..f3ebed8357 100644
--- a/src/dispatcher.js
+++ b/src/dispatcher.js
@@ -16,13 +16,13 @@ limitations under the License.
'use strict';
-var flux = require("flux");
+const flux = require("flux");
class MatrixDispatcher extends flux.Dispatcher {
/**
* @param {Object} payload Required. The payload to dispatch.
* Must contain at least an 'action' key.
- * @param {boolean} sync Optional. Pass true to dispatch
+ * @param {boolean=} sync Optional. Pass true to dispatch
* synchronously. This is useful for anything triggering
* an operation that the browser requires user interaction
* for.