mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +03:00
Enable/disable location share button when setting is changed (#7545)
This commit is contained in:
parent
aa4131ed2e
commit
ae2cb63a0d
1 changed files with 12 additions and 0 deletions
|
@ -254,6 +254,7 @@ interface IState {
|
||||||
showStickers: boolean;
|
showStickers: boolean;
|
||||||
showStickersButton: boolean;
|
showStickersButton: boolean;
|
||||||
showPollsButton: boolean;
|
showPollsButton: boolean;
|
||||||
|
showLocationButton: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@replaceableComponent("views.rooms.MessageComposer")
|
@replaceableComponent("views.rooms.MessageComposer")
|
||||||
|
@ -285,12 +286,14 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
||||||
showStickers: false,
|
showStickers: false,
|
||||||
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
|
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
|
||||||
showPollsButton: SettingsStore.getValue("feature_polls"),
|
showPollsButton: SettingsStore.getValue("feature_polls"),
|
||||||
|
showLocationButton: SettingsStore.getValue("feature_location_share"),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.instanceId = instanceCount++;
|
this.instanceId = instanceCount++;
|
||||||
|
|
||||||
SettingsStore.monitorSetting("MessageComposerInput.showStickersButton", null);
|
SettingsStore.monitorSetting("MessageComposerInput.showStickersButton", null);
|
||||||
SettingsStore.monitorSetting("feature_polls", null);
|
SettingsStore.monitorSetting("feature_polls", null);
|
||||||
|
SettingsStore.monitorSetting("feature_location_share", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -344,6 +347,15 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "feature_location_share": {
|
||||||
|
const showLocationButton = SettingsStore.getValue(
|
||||||
|
"feature_location_share");
|
||||||
|
if (this.state.showLocationButton !== showLocationButton) {
|
||||||
|
this.setState({ showLocationButton });
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue