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

Commit

Permalink
Disable location sharing button on Desktop (#7590)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam authored Jan 21, 2022
1 parent 8f7fa07 commit 09a1bc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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

0 comments on commit 09a1bc6

Please sign in to comment.