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

Add UIFeature.locationSharing to hide location sharing #10727

Merged
merged 2 commits into from
Apr 28, 2023
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
5 changes: 4 additions & 1 deletion src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import { setUpVoiceBroadcastPreRecording } from "../../../voice-broadcast/utils/
import { SdkContextClass } from "../../../contexts/SDKContext";
import { VoiceBroadcastInfoState } from "../../../voice-broadcast";
import { createCantStartVoiceMessageBroadcastDialog } from "../dialogs/CantStartVoiceMessageBroadcastDialog";
import { UIFeature } from "../../../settings/UIFeature";

let instanceCount = 0;

Expand Down Expand Up @@ -614,7 +615,9 @@ export class MessageComposer extends React.Component<IProps, IState> {
relation={this.props.relation}
onRecordStartEndClick={this.onRecordStartEndClick}
setStickerPickerOpen={this.setStickerPickerOpen}
showLocationButton={!window.electron}
showLocationButton={
!window.electron && SettingsStore.getValue(UIFeature.LocationSharing)
}
showPollsButton={this.state.showPollsButton}
showStickersButton={this.showStickersButton}
isRichTextEnabled={this.state.isRichTextEnabled}
Expand Down
4 changes: 4 additions & 0 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,10 @@ export const SETTINGS: { [setting: string]: ISetting } = {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.LocationSharing]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.Voip]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
Expand Down
3 changes: 2 additions & 1 deletion src/settings/UIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ limitations under the License.
*/

// see settings.md for documentation on conventions
export enum UIFeature {
export const enum UIFeature {
AdvancedEncryption = "UIFeature.advancedEncryption",
URLPreviews = "UIFeature.urlPreviews",
Widgets = "UIFeature.widgets",
LocationSharing = "UIFeature.locationSharing",
Voip = "UIFeature.voip",
Feedback = "UIFeature.feedback",
Registration = "UIFeature.registration",
Expand Down