Enable CIDER composer by default

Also convert the setting to a watched setting to apply in realtime.
This commit is contained in:
Travis Ralston 2019-10-03 23:20:00 -06:00
parent 47c41759f7
commit 853c522467
4 changed files with 21 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.setState({useCider: SettingsStore.getValue("useCiderComposer")});
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

View File

@ -26,6 +26,7 @@ import PlatformPeg from "../../../../../PlatformPeg";
export default class PreferencesUserSettingsTab extends React.Component {
static COMPOSER_SETTINGS = [
'useCiderComposer',
'MessageComposerInput.autoReplaceEmoji',
'MessageComposerInput.suggestEmoji',
'sendTypingNotifications',

View File

@ -331,8 +331,8 @@
"Custom user status messages": "Custom user status messages",
"Group & filter rooms by custom tags (refresh to apply changes)": "Group & filter rooms by custom tags (refresh to apply changes)",
"Render simple counters in room header": "Render simple counters in room header",
"Use the new, faster, but still experimental composer for writing messages (requires refresh)": "Use the new, faster, but still experimental composer for writing messages (requires refresh)",
"Multiple integration managers": "Multiple integration managers",
"Use the new, faster, composer for writing messages": "Use the new, faster, composer for writing messages",
"Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing",
"Use compact timeline layout": "Use compact timeline layout",
"Show a placeholder for removed messages": "Show a placeholder for removed messages",

View File

@ -114,19 +114,18 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_cider_composer": {
isFeature: true,
displayName: _td("Use the new, faster, but still experimental composer " +
"for writing messages (requires refresh)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_many_integration_managers": {
isFeature: true,
displayName: _td("Multiple integration managers"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"useCiderComposer": {
isFeature: true,
displayName: _td("Use the new, faster, composer for writing messages"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: true,
},
"MessageComposerInput.suggestEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable Emoji suggestions while typing'),