fix(rn) disables joinButton while navigating
This commit is contained in:
parent
6c9441fa7b
commit
be7f2643df
|
@ -69,6 +69,8 @@ const Prejoin: React.FC<PrejoinProps> = ({ navigation }: PrejoinProps) => {
|
||||||
const participantName = localParticipant?.name;
|
const participantName = localParticipant?.name;
|
||||||
const [ displayName, setDisplayName ]
|
const [ displayName, setDisplayName ]
|
||||||
= useState(participantName || '');
|
= useState(participantName || '');
|
||||||
|
const [ isJoining, setIsJoining ]
|
||||||
|
= useState(false);
|
||||||
const onChangeDisplayName = useCallback(event => {
|
const onChangeDisplayName = useCallback(event => {
|
||||||
const fieldValue = getFieldValue(event);
|
const fieldValue = getFieldValue(event);
|
||||||
|
|
||||||
|
@ -79,6 +81,7 @@ const Prejoin: React.FC<PrejoinProps> = ({ navigation }: PrejoinProps) => {
|
||||||
}, [ displayName ]);
|
}, [ displayName ]);
|
||||||
|
|
||||||
const onJoin = useCallback(() => {
|
const onJoin = useCallback(() => {
|
||||||
|
setIsJoining(true);
|
||||||
dispatch(connect());
|
dispatch(connect());
|
||||||
navigateRoot(screen.conference.root);
|
navigateRoot(screen.conference.root);
|
||||||
}, [ dispatch ]);
|
}, [ dispatch ]);
|
||||||
|
@ -111,7 +114,7 @@ const Prejoin: React.FC<PrejoinProps> = ({ navigation }: PrejoinProps) => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const { PRIMARY, SECONDARY } = BUTTON_TYPES;
|
const { PRIMARY, SECONDARY } = BUTTON_TYPES;
|
||||||
const joinButtonDisabled = !displayName && isDisplayNameMandatory;
|
const joinButtonDisabled = isJoining || (!displayName && isDisplayNameMandatory);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
BackHandler.addEventListener('hardwareBackPress', goBack);
|
BackHandler.addEventListener('hardwareBackPress', goBack);
|
||||||
|
@ -180,6 +183,7 @@ const Prejoin: React.FC<PrejoinProps> = ({ navigation }: PrejoinProps) => {
|
||||||
type = { PRIMARY } />
|
type = { PRIMARY } />
|
||||||
<Button
|
<Button
|
||||||
accessibilityLabel = 'prejoin.joinMeetingInLowBandwidthMode'
|
accessibilityLabel = 'prejoin.joinMeetingInLowBandwidthMode'
|
||||||
|
disabled = { joinButtonDisabled }
|
||||||
labelKey = 'prejoin.joinMeetingInLowBandwidthMode'
|
labelKey = 'prejoin.joinMeetingInLowBandwidthMode'
|
||||||
onClick = { onJoinLowBandwidth }
|
onClick = { onJoinLowBandwidth }
|
||||||
style = { styles.prejoinButton }
|
style = { styles.prejoinButton }
|
||||||
|
|
Loading…
Reference in New Issue