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

Commit e1cdbe1

Browse files
authored
Use IncompatibleController to disable showLocation via labs flag (#7566)
1 parent a2f0948 commit e1cdbe1

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/components/views/rooms/MessageComposer.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
286286
showStickers: false,
287287
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
288288
showPollsButton: SettingsStore.getValue("feature_polls"),
289-
showLocationButton: (
290-
SettingsStore.getValue("feature_location_share") &&
291-
SettingsStore.getValue("MessageComposerInput.showLocationButton")
292-
),
289+
showLocationButton: SettingsStore.getValue("MessageComposerInput.showLocationButton"),
293290
};
294291

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

355352
case "MessageComposerInput.showLocationButton":
356353
case "feature_location_share": {
357-
const showLocationButton = (
358-
SettingsStore.getValue("feature_location_share") &&
359-
SettingsStore.getValue(
360-
"MessageComposerInput.showLocationButton",
361-
)
362-
);
354+
const showLocationButton = SettingsStore.getValue(
355+
"MessageComposerInput.showLocationButton");
356+
363357
if (this.state.showLocationButton !== showLocationButton) {
364358
this.setState({ showLocationButton });
365359
}

src/settings/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
418418
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
419419
displayName: _td('Enable location sharing'),
420420
default: true,
421-
controller: new UIFeatureController(UIFeature.Widgets, false),
421+
controller: new IncompatibleController("feature_location_share", false, false),
422422
},
423423
// TODO: Wire up appropriately to UI (FTUE notifications)
424424
"Notifications.alwaysShowBadgeCounts": {

0 commit comments

Comments
 (0)