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

Commit 457c1d0

Browse files
authored
Add UIFeature.locationSharing to hide location sharing (#10727)
* Add UIFeature.locationSharing to hide location sharing * Iterate
1 parent d084c34 commit 457c1d0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/components/views/rooms/MessageComposer.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { setUpVoiceBroadcastPreRecording } from "../../../voice-broadcast/utils/
6060
import { SdkContextClass } from "../../../contexts/SDKContext";
6161
import { VoiceBroadcastInfoState } from "../../../voice-broadcast";
6262
import { createCantStartVoiceMessageBroadcastDialog } from "../dialogs/CantStartVoiceMessageBroadcastDialog";
63+
import { UIFeature } from "../../../settings/UIFeature";
6364

6465
let instanceCount = 0;
6566

@@ -614,7 +615,9 @@ export class MessageComposer extends React.Component<IProps, IState> {
614615
relation={this.props.relation}
615616
onRecordStartEndClick={this.onRecordStartEndClick}
616617
setStickerPickerOpen={this.setStickerPickerOpen}
617-
showLocationButton={!window.electron}
618+
showLocationButton={
619+
!window.electron && SettingsStore.getValue(UIFeature.LocationSharing)
620+
}
618621
showPollsButton={this.state.showPollsButton}
619622
showStickersButton={this.showStickersButton}
620623
isRichTextEnabled={this.state.isRichTextEnabled}

src/settings/Settings.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,10 @@ export const SETTINGS: { [setting: string]: ISetting } = {
10891089
supportedLevels: LEVELS_UI_FEATURE,
10901090
default: true,
10911091
},
1092+
[UIFeature.LocationSharing]: {
1093+
supportedLevels: LEVELS_UI_FEATURE,
1094+
default: true,
1095+
},
10921096
[UIFeature.Voip]: {
10931097
supportedLevels: LEVELS_UI_FEATURE,
10941098
default: true,

src/settings/UIFeature.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ limitations under the License.
1515
*/
1616

1717
// see settings.md for documentation on conventions
18-
export enum UIFeature {
18+
export const enum UIFeature {
1919
AdvancedEncryption = "UIFeature.advancedEncryption",
2020
URLPreviews = "UIFeature.urlPreviews",
2121
Widgets = "UIFeature.widgets",
22+
LocationSharing = "UIFeature.locationSharing",
2223
Voip = "UIFeature.voip",
2324
Feedback = "UIFeature.feedback",
2425
Registration = "UIFeature.registration",

0 commit comments

Comments
 (0)