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

Disable location sharing button on Desktop #7590

Merged
merged 1 commit into from
Jan 21, 2022
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
11 changes: 8 additions & 3 deletions src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {
isMenuOpen: false,
showStickers: false,
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
showLocationButton: SettingsStore.getValue("MessageComposerInput.showLocationButton"),
showLocationButton: (
!window.electron &&
SettingsStore.getValue("MessageComposerInput.showLocationButton")
),
};

this.instanceId = instanceCount++;
Expand Down Expand Up @@ -340,8 +343,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {

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

if (this.state.showLocationButton !== showLocationButton) {
this.setState({ showLocationButton });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
getShowLocationIfEnabled(): string[] {
// TODO: when location sharing is out of labs, this can be deleted and
// we can just add this to COMPOSER_SETTINGS
if (SettingsStore.getValue("feature_location_share")) {
if (!window.electron && SettingsStore.getValue("feature_location_share")) {
return ['MessageComposerInput.showLocationButton'];
} else {
return [];
Expand Down