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(mobile/navigation): reload now navigates to conference (#12919)

Calinteodor00ed794c50b2
diff --git a/react/features/app/actions.native.ts b/react/features/app/actions.native.ts
index c5fc3eb509..f4812b9dec 100644
--- a/react/features/app/actions.native.ts
+++ b/react/features/app/actions.native.ts
@@ -33,7 +33,7 @@ import { clearNotifications } from '../notifications/actions';
import { addTrackStateToURL, getDefaultURL } from './functions.native';
import logger from './logger';
-import { IStore } from './types';
+import { IReloadNowOptions, IStore } from './types';
export * from './actions.any';
@@ -44,9 +44,10 @@ export * from './actions.any';
* @param {string|undefined} uri - The URI to which to navigate. It may be a
* full URL with an HTTP(S) scheme, a full or partial URI with the app-specific
* scheme, or a mere room name.
+ * @param {Object} [options] - Options.
* @returns {Function}
*/
-export function appNavigate(uri?: string) {
+export function appNavigate(uri?: string, options: IReloadNowOptions = {}) {
logger.info(`appNavigate to ${uri}`);
return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
@@ -142,7 +143,10 @@ export function appNavigate(uri?: string) {
dispatch(createDesiredLocalTracks());
dispatch(clearNotifications());
- if (isPrejoinPageEnabled(getState())) {
+ // @ts-ignore
+ const { hidePrejoin } = options;
+
+ if (!hidePrejoin && isPrejoinPageEnabled(getState())) {
navigateRoot(screen.preJoin);
} else {
dispatch(connect());
@@ -185,6 +189,8 @@ export function reloadNow() {
logger.info(`Reloading the conference using URL: ${locationURL}`);
- dispatch(appNavigate(toURLString(newURL)));
+ dispatch(appNavigate(toURLString(newURL), {
+ hidePrejoin: true
+ }));
};
}
diff --git a/react/features/app/types.ts b/react/features/app/types.ts
index 53537d65c3..c041c5aa77 100644
--- a/react/features/app/types.ts
+++ b/react/features/app/types.ts
@@ -165,3 +165,7 @@ export interface IReduxState {
'features/virtual-background': IVirtualBackground;
'features/whiteboard': IWhiteboardState;
}
+
+export interface IReloadNowOptions {
+ hidePrejoin?: boolean;
+}
diff --git a/react/features/overlay/middleware.ts b/react/features/overlay/middleware.ts
index 98a63cd3ac..b20e91b82d 100644
--- a/react/features/overlay/middleware.ts
+++ b/react/features/overlay/middleware.ts
@@ -33,12 +33,13 @@ type ErrorType = {
};
/**
- * List of errors that are not fatal (or handled differently) so then the overlays won't kick in.
+ * List of errors that are not fatal (or handled differently) so then the page reload dialog won't kick in.
*/
-const NON_OVERLAY_ERRORS = [
+const RN_NO_RELOAD_DIALOG_ERRORS = [
JitsiConferenceErrors.CONFERENCE_ACCESS_DENIED,
JitsiConferenceErrors.CONFERENCE_DESTROYED,
- JitsiConferenceErrors.CONNECTION_ERROR
+ JitsiConferenceErrors.CONNECTION_ERROR,
+ JitsiConferenceErrors.CONFERENCE_RESTARTED
];
const ERROR_TYPES = {
@@ -109,7 +110,7 @@ StateListenerRegistry.register(
});
}
- if (NON_OVERLAY_ERRORS.indexOf(error.name) === -1 && typeof error.recoverable === 'undefined') {
+ if (RN_NO_RELOAD_DIALOG_ERRORS.indexOf(error.name) === -1 && typeof error.recoverable === 'undefined') {
setTimeout(() => {
// @ts-ignore
store.dispatch(openPageReloadDialog());