|
@@ -43,6 +43,7 @@ import {
|
43
|
43
|
import { INotificationProps } from '../notifications/types';
|
44
|
44
|
import { open as openParticipantsPane } from '../participants-pane/actions';
|
45
|
45
|
import { getParticipantsPaneOpen } from '../participants-pane/functions';
|
|
46
|
+import { PREJOIN_JOINING_IN_PROGRESS } from '../prejoin/actionTypes';
|
46
|
47
|
import {
|
47
|
48
|
isPrejoinEnabledInConfig,
|
48
|
49
|
isPrejoinPageVisible,
|
|
@@ -108,6 +109,14 @@ MiddlewareRegistry.register(store => next => action => {
|
108
|
109
|
|
109
|
110
|
return result;
|
110
|
111
|
}
|
|
112
|
+ case PREJOIN_JOINING_IN_PROGRESS: {
|
|
113
|
+ if (action.value) {
|
|
114
|
+ // let's hide the notification (the case with denied access and retrying) when prejoin is enabled
|
|
115
|
+ store.dispatch(hideNotification(LOBBY_NOTIFICATION_ID));
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ break;
|
|
119
|
+ }
|
111
|
120
|
}
|
112
|
121
|
|
113
|
122
|
return next(action);
|
|
@@ -270,9 +279,8 @@ function _handleLobbyNotification(store: IStore) {
|
270
|
279
|
function _conferenceFailed({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
|
271
|
280
|
const { error } = action;
|
272
|
281
|
const state = getState();
|
273
|
|
- const { membersOnly } = state['features/base/conference'];
|
|
282
|
+ const { lobbyError, membersOnly } = state['features/base/conference'];
|
274
|
283
|
const nonFirstFailure = Boolean(membersOnly);
|
275
|
|
- const { isDisplayNameRequiredError } = state['features/lobby'];
|
276
|
284
|
|
277
|
285
|
if (error.name === JitsiConferenceErrors.MEMBERS_ONLY_ERROR) {
|
278
|
286
|
if (typeof error.recoverable === 'undefined') {
|
|
@@ -288,7 +296,7 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
|
288
|
296
|
|
289
|
297
|
// if there was an error about display name and pre-join is not enabled
|
290
|
298
|
if (shouldAutoKnock(state)
|
291
|
|
- || (isDisplayNameRequiredError && !isPrejoinEnabledInConfig(state))
|
|
299
|
+ || (lobbyError && !isPrejoinEnabledInConfig(state))
|
292
|
300
|
|| lobbyWaitingForHost) {
|
293
|
301
|
dispatch(startKnocking());
|
294
|
302
|
}
|
|
@@ -315,7 +323,17 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
|
315
|
323
|
return result;
|
316
|
324
|
}
|
317
|
325
|
|
318
|
|
- dispatch(hideLobbyScreen());
|
|
326
|
+ // if both are available pre-join is with priority (the case when pre-join is enabled)
|
|
327
|
+ // when pre-join is disabled, and we are in lobby with error, we want to end up in lobby UI
|
|
328
|
+ // instead of hiding it and showing conference UI. Still in lobby the user can retry
|
|
329
|
+ // after we show the error notification
|
|
330
|
+ if (isPrejoinPageVisible(state)) {
|
|
331
|
+ dispatch(hideLobbyScreen());
|
|
332
|
+ }
|
|
333
|
+
|
|
334
|
+ // we want to finish this action before showing the notification
|
|
335
|
+ // as the conference will be cleared which will clear all notifications, including this one
|
|
336
|
+ const result = next(action);
|
319
|
337
|
|
320
|
338
|
if (error.name === JitsiConferenceErrors.CONFERENCE_ACCESS_DENIED) {
|
321
|
339
|
dispatch(
|
|
@@ -323,12 +341,13 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
|
323
|
341
|
appearance: NOTIFICATION_TYPE.ERROR,
|
324
|
342
|
hideErrorSupportLink: true,
|
325
|
343
|
titleKey: 'lobby.joinRejectedTitle',
|
|
344
|
+ uid: LOBBY_NOTIFICATION_ID,
|
326
|
345
|
descriptionKey: 'lobby.joinRejectedMessage'
|
327
|
|
- }, NOTIFICATION_TIMEOUT_TYPE.LONG)
|
|
346
|
+ }, NOTIFICATION_TIMEOUT_TYPE.STICKY)
|
328
|
347
|
);
|
329
|
348
|
}
|
330
|
349
|
|
331
|
|
- return next(action);
|
|
350
|
+ return result;
|
332
|
351
|
}
|
333
|
352
|
|
334
|
353
|
/**
|