Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Enable CIDER composer by default #3519

Merged
merged 2 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ module.exports = createReactClass({

canReact: false,
canReply: false,

useCider: false,
};
},

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import PlatformPeg from "../../../../../PlatformPeg";

export default class PreferencesUserSettingsTab extends React.Component {
static COMPOSER_SETTINGS = [
'useCiderComposer',
'MessageComposerInput.autoReplaceEmoji',
'MessageComposerInput.suggestEmoji',
'sendTypingNotifications',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 5 additions & 7 deletions src/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,17 @@ 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": {
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'),
Expand Down