diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 27b9d93e50f..4de573479d8 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -166,6 +166,8 @@ module.exports = createReactClass({ canReact: false, canReply: false, + + useCider: false, }; }, @@ -201,6 +203,14 @@ module.exports = createReactClass({ this._onRoomViewStoreUpdate(true); WidgetEchoStore.on('update', this._onWidgetEchoStoreUpdate); + + this._onCiderUpdated(); + this._ciderWatcherRef = SettingsStore.watchSetting( + "useCiderComposer", null, this._onCiderUpdated); + }, + + _onCiderUpdated: function() { + this.setState({useCider: SettingsStore.getValue("useCiderComposer")}); }, _onRoomViewStoreUpdate: function(initial) { @@ -479,6 +489,8 @@ module.exports = createReactClass({ // (We could use isMounted, but facebook have deprecated that.) this.unmounted = true; + SettingsStore.unwatchSetting(this._ciderWatcherRef); + // update the scroll map before we get unmounted if (this.state.roomId) { RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState()); @@ -1793,7 +1805,7 @@ module.exports = createReactClass({ myMembership === 'join' && !this.state.searchResults ); if (canSpeak) { - if (SettingsStore.isFeatureEnabled("feature_cider_composer")) { + if (this.state.useCider) { const MessageComposer = sdk.getComponent('rooms.MessageComposer'); messageComposer =