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(dialog): add disableAutoHideOnSubmit prop

Hristo Terezov04abfe1a3b31
diff --git a/react/features/base/ui/components/web/Dialog.tsx b/react/features/base/ui/components/web/Dialog.tsx
index eee71c2f2d..638651210c 100644
--- a/react/features/base/ui/components/web/Dialog.tsx
+++ b/react/features/base/ui/components/web/Dialog.tsx
@@ -190,6 +190,7 @@ interface IDialogProps {
children?: React.ReactNode;
className?: string;
description?: string;
+ disableAutoHideOnSubmit?: boolean;
disableBackdropClose?: boolean;
disableEnter?: boolean;
hideCloseButton?: boolean;
@@ -211,6 +212,7 @@ const Dialog = ({
children,
className,
description,
+ disableAutoHideOnSubmit = false,
disableBackdropClose,
hideCloseButton,
disableEnter,
@@ -232,7 +234,7 @@ const Dialog = ({
}, [ onCancel ]);
const submit = useCallback(() => {
- dispatch(hideDialog());
+ !disableAutoHideOnSubmit && dispatch(hideDialog());
onSubmit?.();
}, [ onSubmit ]);
diff --git a/react/features/remote-control/components/RemoteControlAuthorizationDialog.js b/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
index 8fa42b1e66..b33af8b7e4 100644
--- a/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
+++ b/react/features/remote-control/components/RemoteControlAuthorizationDialog.js
@@ -2,7 +2,6 @@
import React, { Component } from 'react';
-import { hideDialog } from '../../base/dialog/actions';
import { translate } from '../../base/i18n';
import { getParticipantById } from '../../base/participants';
import { connect } from '../../base/redux';
@@ -138,7 +137,6 @@ class RemoteControlAuthorizationDialog extends Component<Props> {
_onSubmit() {
const { dispatch, participantId } = this.props;
- dispatch(hideDialog());
dispatch(grant(participantId));
return false;
diff --git a/react/features/shared-video/components/web/SharedVideoDialog.tsx b/react/features/shared-video/components/web/SharedVideoDialog.tsx
index 18329f791b..bcef2e4e29 100644
--- a/react/features/shared-video/components/web/SharedVideoDialog.tsx
+++ b/react/features/shared-video/components/web/SharedVideoDialog.tsx
@@ -1,5 +1,6 @@
import React from 'react';
+import { hideDialog } from '../../../base/dialog/actions';
import { translate } from '../../../base/i18n/functions';
import { connect } from '../../../base/redux/functions';
import Dialog from '../../../base/ui/components/web/Dialog';
@@ -52,7 +53,9 @@ class SharedVideoDialog extends AbstractSharedVideoDialog<any> {
_onSubmitValue() {
const result = super._onSetVideoLink(this.state.value);
- if (!result) {
+ if (result) {
+ this.props.dispatch(hideDialog());
+ } else {
this.setState({
error: true
});
@@ -72,6 +75,7 @@ class SharedVideoDialog extends AbstractSharedVideoDialog<any> {
return (
<Dialog
+ disableAutoHideOnSubmit = { true }
ok = {{
disabled: this.state.okDisabled,
translationKey: 'dialog.Share'