diff --git a/frontend/app/components/Session/Player/LivePlayer/Timeline.tsx b/frontend/app/components/Session/Player/LivePlayer/Timeline.tsx index 2bddec240..cba5547b9 100644 --- a/frontend/app/components/Session/Player/LivePlayer/Timeline.tsx +++ b/frontend/app/components/Session/Player/LivePlayer/Timeline.tsx @@ -95,11 +95,10 @@ function Timeline(props: IProps) { const loadAndSeek = async (e: React.MouseEvent) => { e.persist(); - await player.toggleTimetravel(); - - setTimeout(() => { + const result = await player.toggleTimetravel(); + if (result) { seekProgress(e); - }); + } }; const jumpToTime = (e: React.MouseEvent) => { diff --git a/frontend/app/components/shared/SharePopup/SharePopup.js b/frontend/app/components/shared/SharePopup/SharePopup.js index 5e01dde3d..984ce0060 100644 --- a/frontend/app/components/shared/SharePopup/SharePopup.js +++ b/frontend/app/components/shared/SharePopup/SharePopup.js @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { toast } from 'react-toastify'; -import { Icon, Button, Popover } from 'UI'; +import { Icon, Button, Popover, Loader } from 'UI'; import styles from './sharePopup.module.css'; import IntegrateSlackButton from '../IntegrateSlackButton/IntegrateSlackButton'; import SessionCopyLink from './SessionCopyLink'; @@ -29,12 +29,14 @@ export default class SharePopup extends React.PureComponent { loadingTeams: false, }; - componentDidMount() { - if (this.props.channels.size === 0) { - this.props.fetchSlack(); - } - if (this.props.msTeamsChannels.size === 0) { - this.props.fetchTeams(); + componentDidUpdate() { + if (this.state.isOpen) { + if (this.props.channels.size === 0) { + this.props.fetchSlack(); + } + if (this.props.msTeamsChannels.size === 0) { + this.props.fetchTeams(); + } } } @@ -76,7 +78,10 @@ export default class SharePopup extends React.PureComponent { }; handleSuccess = (endpoint) => { - const obj = endpoint === 'Slack' ? { isOpen: false, comment: '', loadingSlack: false } : { isOpen: false, comment: '', loadingTeams: false } + const obj = + endpoint === 'Slack' + ? { isOpen: false, comment: '', loadingSlack: false } + : { isOpen: false, comment: '', loadingTeams: false }; this.setState(obj); toast.success(`Sent to ${endpoint}.`); }; @@ -103,91 +108,104 @@ export default class SharePopup extends React.PureComponent { return ( this.setState({ isOpen: true })} + onClose={() => this.setState({ isOpen: false })} render={() => (
-
-
- Share this session link to Slack/MS Teams -
-
- {slackOptions.length > 0 || msTeamsOptions.length > 0 ? ( -
-
-