Merge pull request #3519 from matrix-org/travis/enable-cider

Enable CIDER composer by default
This commit is contained in:
Michael Telatynski 2019-10-04 10:50:28 +01:00 committed by GitHub
commit fba646d2c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View file

@ -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 =
<MessageComposer