feat(invite/security): Brave issues fixes (#14180)

* feat(invite/security): fix share icon/lobby mode switch
This commit is contained in:
Calinteodor
2023-12-21 16:16:28 +02:00
committed by GitHub
parent 998854a22e
commit bf211fbd4d
3 changed files with 20 additions and 13 deletions

View File

@@ -56,7 +56,7 @@ interface IProps {
_isModerator: boolean;
/**
* State of the lobby mode.
* Whether lobby mode is enabled or not.
*/
_lobbyEnabled: boolean;
@@ -107,6 +107,11 @@ interface IProps {
*/
interface IState {
/**
* State of lobby mode.
*/
lobbyEnabled: boolean;
/**
* Password added by the participant for room lock.
*/
@@ -134,6 +139,7 @@ class SecurityDialog extends PureComponent<IProps, IState> {
super(props);
this.state = {
lobbyEnabled: props._lobbyEnabled,
passwordInputValue: '',
showElement: props._locked === LOCKED_LOCALLY || false
};
@@ -168,7 +174,6 @@ class SecurityDialog extends PureComponent<IProps, IState> {
*/
_renderLobbyMode() {
const {
_lobbyEnabled,
_lobbyModeSwitchVisible,
t
} = this.props;
@@ -188,7 +193,7 @@ class SecurityDialog extends PureComponent<IProps, IState> {
{ t('lobby.toggleLabel') }
</Text>
<Switch
checked = { _lobbyEnabled }
checked = { this.state.lobbyEnabled }
onChange = { this._onToggleLobbyMode } />
</View>
</View>
@@ -386,13 +391,14 @@ class SecurityDialog extends PureComponent<IProps, IState> {
* @returns {void}
*/
_onToggleLobbyMode() {
const { _lobbyEnabled, dispatch } = this.props;
const { dispatch } = this.props;
const { lobbyEnabled } = this.state;
if (_lobbyEnabled) {
dispatch(toggleLobbyMode(false));
} else {
dispatch(toggleLobbyMode(true));
}
this.setState({
lobbyEnabled: !lobbyEnabled
});
dispatch(toggleLobbyMode(!lobbyEnabled));
}
/**