From 68a391e24bb6447e127f9a1e81123ca6b5ba8a71 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 19 Mar 2016 22:32:44 +0000 Subject: [PATCH] implement history visibilty warnings --- src/components/views/rooms/RoomSettings.js | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index b6f820efd8..5bd387681c 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -228,8 +228,27 @@ module.exports = React.createClass({ }, _onHistoryRadioToggle: function(ev) { - this.setState({ - history_visibility: ev.target.value + var self = this; + var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); + + // cancel the click unless the user confirms it + ev.preventDefault(); + + Modal.createDialog(QuestionDialog, { + title: "Privacy warning", + description: +
+ Changes to who can read history will only apply to future messages in this room.
+ The visibility of existing history will be unchanged. +
, + button: "Continue", + onFinished: function(confirmed) { + if (confirmed) { + self.setState({ + history_visibility: ev.target.value + }); + } + }, }); }, @@ -438,28 +457,28 @@ module.exports = React.createClass({