Compare commits

...

1 Commits

Author SHA1 Message Date
Hristo Terezov
a403a221ae fix(analytics): prejoin property. 2023-12-08 15:37:19 -06:00
4 changed files with 28 additions and 13 deletions

View File

@@ -159,9 +159,10 @@ export async function createHandlers({ getState }: IStore) {
*
* @param {Store} store - The redux store in which the specified {@code action} is being dispatched.
* @param {Array<Object>} handlers - The analytics handlers.
* @param {boolean|undefined} willShowPrejoin -
* @returns {void}
*/
export function initAnalytics(store: IStore, handlers: Array<Object>) {
export function initAnalytics(store: IStore, handlers: Array<Object>, willShowPrejoin?: boolean) {
const { getState, dispatch } = store;
if (!isAnalyticsEnabled(getState) || handlers.length === 0) {
@@ -212,7 +213,7 @@ export function initAnalytics(store: IStore, handlers: Array<Object>) {
// Report the tenant from the URL.
permanentProperties.tenant = tenant || '/';
permanentProperties.wasPrejoinDisplayed = isPrejoinPageVisible(state);
permanentProperties.wasPrejoinDisplayed = willShowPrejoin ?? isPrejoinPageVisible(state);
// Currently we don't know if there will be lobby. We will update it to true if we go through lobby.
permanentProperties.wasLobbyVisible = false;

View File

@@ -114,7 +114,7 @@ MiddlewareRegistry.register(store => next => action => {
const result = next(action);
createHandlersPromise.then(handlers => {
initAnalytics(store, handlers);
initAnalytics(store, handlers, action.willShowPrejoin);
});
return result;

View File

@@ -150,9 +150,20 @@ export function appNavigate(uri?: string, options: IReloadNowOptions = {}) {
return;
}
let willShowPrejoin = false;
let willShowUnsafeRoomWarning = false;
if (!options.hidePrejoin && isPrejoinPageEnabled(getState()) && room) {
if (isUnsafeRoomWarningEnabled(getState()) && isInsecureRoomName(room)) {
willShowUnsafeRoomWarning = true;
} else {
willShowPrejoin = true;
}
}
dispatch(setLocationURL(locationURL));
dispatch(setConfig(config));
dispatch(setRoom(room));
dispatch(setRoom(room, willShowPrejoin));
if (!room) {
goBackToRoot(getState(), dispatch);
@@ -163,12 +174,10 @@ export function appNavigate(uri?: string, options: IReloadNowOptions = {}) {
dispatch(createDesiredLocalTracks());
dispatch(clearNotifications());
if (!options.hidePrejoin && isPrejoinPageEnabled(getState())) {
if (isUnsafeRoomWarningEnabled(getState()) && isInsecureRoomName(room)) {
navigateRoot(screen.unsafeRoomWarning);
} else {
navigateRoot(screen.preJoin);
}
if (willShowUnsafeRoomWarning) {
navigateRoot(screen.unsafeRoomWarning);
} else if (willShowPrejoin) {
navigateRoot(screen.preJoin);
} else {
dispatch(connect());
navigateRoot(screen.conference.root);

View File

@@ -900,15 +900,20 @@ export function setObfuscatedRoom(obfuscatedRoom: string, obfuscatedRoomSource:
*
* @param {(string|undefined)} room - The name of the room of the conference to
* be joined.
* @param {boolean|undefined} willShowPrejoin - Whether the prejoin should be hidden or not.
* NOTE: This argument is used only for mobile currently!
*
* @returns {{
* type: SET_ROOM,
* room: string
* room: string,
* willShowPrejoin: boolean
* }}
*/
export function setRoom(room?: string) {
export function setRoom(room?: string, willShowPrejoin?: boolean) {
return {
type: SET_ROOM,
room
room,
willShowPrejoin
};
}