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

Use IncompatibleController to disable showLocation via labs flag #7566

Merged
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: 4 additions & 10 deletions src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
showStickers: false,
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
showPollsButton: SettingsStore.getValue("feature_polls"),
showLocationButton: (
SettingsStore.getValue("feature_location_share") &&
SettingsStore.getValue("MessageComposerInput.showLocationButton")
),
showLocationButton: SettingsStore.getValue("MessageComposerInput.showLocationButton"),
};

this.instanceId = instanceCount++;
Expand Down Expand Up @@ -354,12 +351,9 @@ export default class MessageComposer extends React.Component<IProps, IState> {

case "MessageComposerInput.showLocationButton":
case "feature_location_share": {
const showLocationButton = (
SettingsStore.getValue("feature_location_share") &&
SettingsStore.getValue(
"MessageComposerInput.showLocationButton",
)
);
const showLocationButton = SettingsStore.getValue(
"MessageComposerInput.showLocationButton");

if (this.state.showLocationButton !== showLocationButton) {
this.setState({ showLocationButton });
}
Expand Down
2 changes: 1 addition & 1 deletion src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable location sharing'),
default: true,
controller: new UIFeatureController(UIFeature.Widgets, false),
controller: new IncompatibleController("feature_location_share", false, false),
},
// TODO: Wire up appropriately to UI (FTUE notifications)
"Notifications.alwaysShowBadgeCounts": {
Expand Down