Add setting for enabling location sharing (#7547)

This commit is contained in:
Andy Balaam 2022-01-14 15:57:39 +00:00 committed by GitHub
parent ae2cb63a0d
commit 18c82d57ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 5 deletions

View file

@ -296,6 +296,16 @@ 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")) {
return ['MessageComposerInput.showLocationButton'];
} else {
return [];
}
}
render() {
let autoLaunchOption = null;
if (this.state.autoLaunchSupported) {
@ -377,7 +387,10 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
<div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{ _t("Composer") }</span>
{ this.renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS) }
{ this.renderGroup([
...PreferencesUserSettingsTab.COMPOSER_SETTINGS,
...this.getShowLocationIfEnabled(),
]) }
</div>
<div className="mx_SettingsTab_section">