From d0fe034db5deb25be7845257864648e9026d73dc Mon Sep 17 00:00:00 2001 From: Calinteodor Date: Fri, 24 Feb 2023 13:51:27 +0200 Subject: [PATCH] feat(base/dialog): visibility control for PageReloadDialog (#12961) * feat(base/dialog): visibility control for PageReloadDialog --- .../dialog/components/native/ConfirmDialog.js | 2 +- .../components/native/PageReloadDialog.tsx | 99 ++++++++++--------- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/react/features/base/dialog/components/native/ConfirmDialog.js b/react/features/base/dialog/components/native/ConfirmDialog.js index b796c15d2..9d3f8287a 100644 --- a/react/features/base/dialog/components/native/ConfirmDialog.js +++ b/react/features/base/dialog/components/native/ConfirmDialog.js @@ -48,7 +48,7 @@ type Props = { /** * Dialog title. */ - title?: string, + title?: string }; /** diff --git a/react/features/base/dialog/components/native/PageReloadDialog.tsx b/react/features/base/dialog/components/native/PageReloadDialog.tsx index 09bf2b96c..35b56c9cf 100644 --- a/react/features/base/dialog/components/native/PageReloadDialog.tsx +++ b/react/features/base/dialog/components/native/PageReloadDialog.tsx @@ -11,6 +11,7 @@ import { IReduxState } from '../../../../app/types'; import { translate } from '../../../i18n/functions'; import { isFatalJitsiConnectionError } from '../../../lib-jitsi-meet/functions.native'; import { connect } from '../../../redux/functions'; +import { hideDialog } from '../../actions'; // @ts-ignore import logger from '../../logger'; @@ -33,10 +34,7 @@ interface IPageReloadDialogProps extends WithTranslation { * {@link PageReloadDialog}. */ interface IPageReloadDialogState { - message: string; timeLeft: number; - timeoutSeconds: number; - title: string; } /** @@ -48,6 +46,7 @@ class PageReloadDialog extends Component { - if (timeLeft === 0) { - if (this._interval) { - clearInterval(this._interval); - this._interval = undefined; - } - - dispatch(reloadNow()); - } else { - this.setState(prevState => { - return { - timeLeft: prevState.timeLeft - 1 - }; - }); - } - }, - 1000); + this._interval = setInterval(() => + this._onReconnecting(), 1000); } /** @@ -138,12 +107,37 @@ class PageReloadDialog extends Component