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

Commit 09a1bc6

Browse files
authored
Disable location sharing button on Desktop (#7590)
1 parent 8f7fa07 commit 09a1bc6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/views/rooms/MessageComposer.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {
284284
isMenuOpen: false,
285285
showStickers: false,
286286
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
287-
showLocationButton: SettingsStore.getValue("MessageComposerInput.showLocationButton"),
287+
showLocationButton: (
288+
!window.electron &&
289+
SettingsStore.getValue("MessageComposerInput.showLocationButton")
290+
),
288291
};
289292

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

341344
case "MessageComposerInput.showLocationButton":
342345
case "feature_location_share": {
343-
const showLocationButton = SettingsStore.getValue(
344-
"MessageComposerInput.showLocationButton");
346+
const showLocationButton = (
347+
!window.electron &&
348+
SettingsStore.getValue("MessageComposerInput.showLocationButton")
349+
);
345350

346351
if (this.state.showLocationButton !== showLocationButton) {
347352
this.setState({ showLocationButton });

src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
307307
getShowLocationIfEnabled(): string[] {
308308
// TODO: when location sharing is out of labs, this can be deleted and
309309
// we can just add this to COMPOSER_SETTINGS
310-
if (SettingsStore.getValue("feature_location_share")) {
310+
if (!window.electron && SettingsStore.getValue("feature_location_share")) {
311311
return ['MessageComposerInput.showLocationButton'];
312312
} else {
313313
return [];

0 commit comments

Comments
 (0)