Enable location sharing (#7703)

This commit is contained in:
Andy Balaam 2022-02-02 11:44:17 +00:00 committed by GitHub
parent afbc843157
commit 70a44a8cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 59 deletions

View file

@ -87,7 +87,6 @@ interface IState {
isMenuOpen: boolean;
isStickerPickerOpen: boolean;
showStickersButton: boolean;
showLocationButton: boolean;
}
@replaceableComponent("views.rooms.MessageComposer")
@ -118,17 +117,11 @@ export default class MessageComposer extends React.Component<IProps, IState> {
isMenuOpen: false,
isStickerPickerOpen: false,
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
showLocationButton: (
!window.electron &&
SettingsStore.getValue("MessageComposerInput.showLocationButton")
),
};
this.instanceId = instanceCount++;
SettingsStore.monitorSetting("MessageComposerInput.showStickersButton", null);
SettingsStore.monitorSetting("MessageComposerInput.showLocationButton", null);
SettingsStore.monitorSetting("feature_location_share", null);
}
componentDidMount() {
@ -174,19 +167,6 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}
break;
}
case "MessageComposerInput.showLocationButton":
case "feature_location_share": {
const showLocationButton = (
!window.electron &&
SettingsStore.getValue("MessageComposerInput.showLocationButton")
);
if (this.state.showLocationButton !== showLocationButton) {
this.setState({ showLocationButton });
}
break;
}
}
}
}
@ -463,7 +443,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}
}}
setStickerPickerOpen={this.setStickerPickerOpen}
showLocationButton={this.state.showLocationButton}
showLocationButton={!window.electron}
showStickersButton={this.state.showStickersButton}
toggleButtonMenu={this.toggleButtonMenu}
/>