Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(recent-list): fix undefined error that breaks visitor joining (#14024)

Calinteodor2a3c962e88af
diff --git a/react/features/recent-list/middleware.ts b/react/features/recent-list/middleware.ts
index 5d5d30fc90..c431557cc1 100644
--- a/react/features/recent-list/middleware.ts
+++ b/react/features/recent-list/middleware.ts
@@ -83,7 +83,8 @@ function _appWillMount({ dispatch, getState }: IStore, next: Function, action: A
* @returns {*} The result returned by {@code next(action)}.
*/
function _conferenceWillLeave({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
- const { doNotStoreRoom } = getState()['features/base/config'];
+ const state = getState();
+ const { doNotStoreRoom } = state['features/base/config'];
if (!doNotStoreRoom && !inIframe()) {
let locationURL;
@@ -100,13 +101,17 @@ function _conferenceWillLeave({ dispatch, getState }: IStore, next: Function, ac
* JITSI_CONFERENCE_URL_KEY so we cannot call it and must use the other way.
*/
if (typeof APP === 'undefined') {
- locationURL = action.conference[JITSI_CONFERENCE_URL_KEY];
+ const { conference } = action;
+
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
+ locationURL = conference && conference[JITSI_CONFERENCE_URL_KEY];
} else {
- locationURL = getState()['features/base/connection'].locationURL;
+ locationURL = state['features/base/connection'].locationURL;
}
dispatch(
_updateConferenceDuration(
- locationURL));
+ locationURL
+ ));
}
return next(action);