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(authentication): Changes wait for owner cancel txt.

damencho1f8dc944e352
diff --git a/lang/main.json b/lang/main.json
index e1a3c87037..a377dd54a9 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -256,6 +256,7 @@
"Share": "Share",
"Submit": "Submit",
"WaitForHostMsg": "The conference has not yet started because no moderators have yet arrived. If you'd like to become a moderator please log-in. Otherwise, please wait.",
+ "WaitingForHostButton": "Wait for moderator",
"WaitingForHostTitle": "Waiting for a moderator...",
"Yes": "Yes",
"accessibilityLabel": {
diff --git a/react/features/authentication/components/native/WaitForOwnerDialog.tsx b/react/features/authentication/components/native/WaitForOwnerDialog.tsx
index 46d02608f5..e08caa2c43 100644
--- a/react/features/authentication/components/native/WaitForOwnerDialog.tsx
+++ b/react/features/authentication/components/native/WaitForOwnerDialog.tsx
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
-import { IStore } from '../../../app/types';
+import { IReduxState, IStore } from '../../../app/types';
import ConfirmDialog from '../../../base/dialog/components/native/ConfirmDialog';
import { translate } from '../../../base/i18n/functions';
import { cancelWaitForOwner, login } from '../../actions.native';
@@ -12,6 +12,11 @@ import { cancelWaitForOwner, login } from '../../actions.native';
*/
interface IProps {
+ /**
+ * Whether to show alternative cancel button text.
+ */
+ _alternativeCancelText?: boolean;
+
/**
* Redux store dispatch function.
*/
@@ -53,7 +58,7 @@ class WaitForOwnerDialog extends Component<IProps> {
render() {
return (
<ConfirmDialog
- cancelLabel = 'dialog.Cancel'
+ cancelLabel = { this.props._alternativeCancelText ? 'dialog.WaitingForHostButton' : 'dialog.Cancel' }
confirmLabel = 'dialog.IamHost'
descriptionKey = 'dialog.WaitForHostMsg'
onCancel = { this._onCancel }
@@ -84,4 +89,20 @@ class WaitForOwnerDialog extends Component<IProps> {
}
}
-export default translate(connect()(WaitForOwnerDialog));
+/**
+ * Maps (parts of) the redux state to the associated
+ * {@code WaitForOwnerDialog}'s props.
+ *
+ * @param {Object} state - The redux state.
+ * @private
+ * @returns {IProps}
+ */
+function mapStateToProps(state: IReduxState) {
+ const { membersOnly, lobbyWaitingForHost } = state['features/base/conference'];
+
+ return {
+ _alternativeCancelText: membersOnly && lobbyWaitingForHost
+ };
+}
+
+export default translate(connect(mapStateToProps)(WaitForOwnerDialog));
diff --git a/react/features/authentication/components/web/WaitForOwnerDialog.tsx b/react/features/authentication/components/web/WaitForOwnerDialog.tsx
index f55229a26e..c47a7fbf2a 100644
--- a/react/features/authentication/components/web/WaitForOwnerDialog.tsx
+++ b/react/features/authentication/components/web/WaitForOwnerDialog.tsx
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { WithTranslation } from 'react-i18next';
import { connect } from 'react-redux';
-import { IStore } from '../../../app/types';
+import { IReduxState, IStore } from '../../../app/types';
import { translate } from '../../../base/i18n/functions';
import Dialog from '../../../base/ui/components/web/Dialog';
import { cancelWaitForOwner, login } from '../../actions.web';
@@ -12,6 +12,11 @@ import { cancelWaitForOwner, login } from '../../actions.web';
*/
interface IProps extends WithTranslation {
+ /**
+ * Whether to show alternative cancel button text.
+ */
+ _alternativeCancelText?: boolean;
+
/**
* Redux store dispatch method.
*/
@@ -71,6 +76,8 @@ class WaitForOwnerDialog extends PureComponent<IProps> {
return (
<Dialog
+ cancel = {{ translationKey:
+ this.props._alternativeCancelText ? 'dialog.WaitingForHostButton' : 'dialog.Cancel' }}
disableBackdropClose = { true }
hideCloseButton = { true }
ok = {{ translationKey: 'dialog.IamHost' }}
@@ -85,4 +92,20 @@ class WaitForOwnerDialog extends PureComponent<IProps> {
}
}
-export default translate(connect()(WaitForOwnerDialog));
+/**
+ * Maps (parts of) the redux state to the associated
+ * {@code WaitForOwnerDialog}'s props.
+ *
+ * @param {Object} state - The redux state.
+ * @private
+ * @returns {IProps}
+ */
+function mapStateToProps(state: IReduxState) {
+ const { membersOnly, lobbyWaitingForHost } = state['features/base/conference'];
+
+ return {
+ _alternativeCancelText: membersOnly && lobbyWaitingForHost
+ };
+}
+
+export default translate(connect(mapStateToProps)(WaitForOwnerDialog));