Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(calendar): join button goes to meeting

Leonard Kimf148b5010061
diff --git a/react/features/calendar-sync/components/BaseCalendarList.js b/react/features/calendar-sync/components/BaseCalendarList.js
index 276430fa02..d55533308d 100644
--- a/react/features/calendar-sync/components/BaseCalendarList.js
+++ b/react/features/calendar-sync/components/BaseCalendarList.js
@@ -202,7 +202,9 @@ class BaseCalendarList extends Component<Props> {
_toDisplayableItem(event) {
return {
elementAfter: event.url
- ? <JoinButton onPress = { this._onJoinPress } />
+ ? <JoinButton
+ onPress = { this._onJoinPress }
+ url = { event.url } />
: (<AddMeetingUrlButton
calendarId = { event.calendarId }
eventId = { event.id } />),
diff --git a/react/features/calendar-sync/components/JoinButton.web.js b/react/features/calendar-sync/components/JoinButton.web.js
index c394054011..c99b6264e4 100644
--- a/react/features/calendar-sync/components/JoinButton.web.js
+++ b/react/features/calendar-sync/components/JoinButton.web.js
@@ -16,6 +16,11 @@ type Props = {
*/
onPress: Function,
+ /**
+ * The meeting URL associated with the {@link JoinButton} instance.
+ */
+ url: string,
+
/**
* Invoked to obtain translated strings.
*/
@@ -29,13 +34,26 @@ type Props = {
*/
class JoinButton extends Component<Props> {
+ /**
+ * Initializes a new {@code JoinButton} instance.
+ *
+ * @param {*} props - The read-only properties with which the new instance
+ * is to be initialized.
+ */
+ constructor(props) {
+ super(props);
+
+ // Bind event handler so it is only bound once for every instance.
+ this._onClick = this._onClick.bind(this);
+ }
+
/**
* Implements React's {@link Component#render}.
*
* @inheritdoc
*/
render() {
- const { onPress, t } = this.props;
+ const { t } = this.props;
return (
<Tooltip
@@ -43,13 +61,26 @@ class JoinButton extends Component<Props> {
<Button
appearance = 'primary'
className = 'join-button'
- onClick = { onPress }
+ onClick = { this._onClick }
type = 'button'>
{ t('calendarSync.join') }
</Button>
</Tooltip>
);
}
+
+ _onClick: (Object) => void;
+
+ /**
+ * Callback invoked when the component is clicked.
+ *
+ * @param {Object} event - The DOM click event.
+ * @private
+ * @returns {void}
+ */
+ _onClick(event) {
+ this.props.onPress(event, this.props.url);
+ }
}
export default translate(JoinButton);