fix(prejoin) don't hide during auth

Fix the focus issue by disabling autofocus in case an auth (login, ait
for owner or password) dialog is shown.

Fixes: https://github.com/jitsi/docker-jitsi-meet/issues/1336
This commit is contained in:
Saúl Ibarra Corretgé 2022-07-04 21:47:59 +02:00 committed by Saúl Ibarra Corretgé
parent dffa71666c
commit a5da90ddaf
5 changed files with 15 additions and 12 deletions

View File

@ -21,8 +21,7 @@ import { isFatalJitsiConnectionError } from './react/features/base/lib-jitsi-mee
import { getCustomerDetails } from './react/features/jaas/actions.any'; import { getCustomerDetails } from './react/features/jaas/actions.any';
import { isVpaasMeeting, getJaasJWT } from './react/features/jaas/functions'; import { isVpaasMeeting, getJaasJWT } from './react/features/jaas/functions';
import { import {
setPrejoinDisplayNameRequired, setPrejoinDisplayNameRequired
setPrejoinPageVisibility
} from './react/features/prejoin/actions'; } from './react/features/prejoin/actions';
const logger = Logger.getLogger(__filename); const logger = Logger.getLogger(__filename);
@ -247,7 +246,6 @@ function requestAuth(roomName) {
resolve(connection); resolve(connection);
}; };
APP.store.dispatch(setPrejoinPageVisibility(false));
APP.store.dispatch( APP.store.dispatch(
openDialog(LoginDialog, { onSuccess, openDialog(LoginDialog, { onSuccess,
roomName }) roomName })

View File

@ -17,7 +17,6 @@ import {
import { getReplaceParticipant } from '../../../react/features/base/config/functions'; import { getReplaceParticipant } from '../../../react/features/base/config/functions';
import { isDialogOpen } from '../../../react/features/base/dialog'; import { isDialogOpen } from '../../../react/features/base/dialog';
import { setJWT } from '../../../react/features/base/jwt'; import { setJWT } from '../../../react/features/base/jwt';
import { setPrejoinPageVisibility } from '../../../react/features/prejoin';
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import ExternalLoginDialog from './LoginDialog'; import ExternalLoginDialog from './LoginDialog';
@ -181,7 +180,6 @@ function authenticate(room: Object, lockPassword: string) {
if (isTokenAuthEnabled(config) || room.isExternalAuthEnabled()) { if (isTokenAuthEnabled(config) || room.isExternalAuthEnabled()) {
doExternalAuth(room, lockPassword); doExternalAuth(room, lockPassword);
} else { } else {
APP.store.dispatch(setPrejoinPageVisibility(false));
APP.store.dispatch(openLoginDialog()); APP.store.dispatch(openLoginDialog());
} }
} }

View File

@ -15,7 +15,6 @@ import {
JitsiConnectionErrors JitsiConnectionErrors
} from '../base/lib-jitsi-meet'; } from '../base/lib-jitsi-meet';
import { MiddlewareRegistry } from '../base/redux'; import { MiddlewareRegistry } from '../base/redux';
import { setPrejoinPageVisibility } from '../prejoin';
import { import {
CANCEL_LOGIN, CANCEL_LOGIN,
@ -121,7 +120,6 @@ MiddlewareRegistry.register(store => next => action => {
&& error.name === JitsiConnectionErrors.PASSWORD_REQUIRED && error.name === JitsiConnectionErrors.PASSWORD_REQUIRED
&& typeof error.recoverable === 'undefined') { && typeof error.recoverable === 'undefined') {
error.recoverable = true; error.recoverable = true;
store.dispatch(setPrejoinPageVisibility(false));
store.dispatch(openLoginDialog()); store.dispatch(openLoginDialog());
} }
break; break;

View File

@ -46,10 +46,7 @@ MiddlewareRegistry.register(store => next => action => {
case CONFERENCE_FAILED: { case CONFERENCE_FAILED: {
const errorName = action.error?.name; const errorName = action.error?.name;
if (errorName === JitsiConferenceErrors.MEMBERS_ONLY_ERROR if (enableForcedReload && errorName === JitsiConferenceErrors.CONFERENCE_RESTARTED) {
|| errorName === JitsiConferenceErrors.PASSWORD_REQUIRED) {
dispatch(setPrejoinPageVisibility(false));
} else if (enableForcedReload && errorName === JitsiConferenceErrors.CONFERENCE_RESTARTED) {
dispatch(setSkipPrejoinOnReload(true)); dispatch(setSkipPrejoinOnReload(true));
} }

View File

@ -3,9 +3,11 @@
import InlineDialog from '@atlaskit/inline-dialog'; import InlineDialog from '@atlaskit/inline-dialog';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { LoginDialog, WaitForOwnerDialog } from '../../authentication/components';
import { Avatar } from '../../base/avatar'; import { Avatar } from '../../base/avatar';
import { getRoomName } from '../../base/conference'; import { getRoomName } from '../../base/conference';
import { isNameReadOnly } from '../../base/config'; import { isNameReadOnly } from '../../base/config';
import { isDialogOpen } from '../../base/dialog/functions';
import { translate } from '../../base/i18n'; import { translate } from '../../base/i18n';
import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons'; import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons';
import { isVideoMutedByUser } from '../../base/media'; import { isVideoMutedByUser } from '../../base/media';
@ -14,6 +16,7 @@ import { ActionButton, InputField, PreMeetingScreen } from '../../base/premeetin
import { connect } from '../../base/redux'; import { connect } from '../../base/redux';
import { getDisplayName, updateSettings } from '../../base/settings'; import { getDisplayName, updateSettings } from '../../base/settings';
import { getLocalJitsiVideoTrack } from '../../base/tracks'; import { getLocalJitsiVideoTrack } from '../../base/tracks';
import { PasswordRequiredPrompt } from '../../room-lock/components';
import { import {
joinConference as joinConferenceAction, joinConference as joinConferenceAction,
joinConferenceWithoutAudio as joinConferenceWithoutAudioAction, joinConferenceWithoutAudio as joinConferenceWithoutAudioAction,
@ -47,6 +50,11 @@ type Props = {
*/ */
hasJoinByPhoneButton: boolean, hasJoinByPhoneButton: boolean,
/**
* Whether authentication is taking place or not.
*/
isAuthInProgress: boolean,
/** /**
* Joins the current meeting. * Joins the current meeting.
*/ */
@ -342,6 +350,7 @@ class Prejoin extends Component<Props, State> {
const { const {
deviceStatusVisible, deviceStatusVisible,
hasJoinByPhoneButton, hasJoinByPhoneButton,
isAuthInProgress,
joinConference, joinConference,
joinConferenceWithoutAudio, joinConferenceWithoutAudio,
name, name,
@ -378,7 +387,7 @@ class Prejoin extends Component<Props, State> {
data-testid = 'prejoin.screen'> data-testid = 'prejoin.screen'>
{this.showDisplayNameField ? (<InputField {this.showDisplayNameField ? (<InputField
autoComplete = { 'name' } autoComplete = { 'name' }
autoFocus = { true } autoFocus = { !isAuthInProgress }
className = { showError ? 'error' : '' } className = { showError ? 'error' : '' }
hasError = { showError } hasError = { showError }
onChange = { _setName } onChange = { _setName }
@ -450,11 +459,14 @@ function mapStateToProps(state): Object {
const name = getDisplayName(state); const name = getDisplayName(state);
const showErrorOnJoin = isDisplayNameRequired(state) && !name; const showErrorOnJoin = isDisplayNameRequired(state) && !name;
const { id: participantId } = getLocalParticipant(state); const { id: participantId } = getLocalParticipant(state);
const isAuthInProgress = isDialogOpen(state, WaitForOwnerDialog)
|| isDialogOpen(state, LoginDialog) || isDialogOpen(state, PasswordRequiredPrompt);
return { return {
canEditDisplayName: isPrejoinDisplayNameVisible(state), canEditDisplayName: isPrejoinDisplayNameVisible(state),
deviceStatusVisible: isDeviceStatusVisible(state), deviceStatusVisible: isDeviceStatusVisible(state),
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state), hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
isAuthInProgress,
name, name,
participantId, participantId,
prejoinConfig: state['features/base/config'].prejoinConfig, prejoinConfig: state['features/base/config'].prejoinConfig,