diff --git a/frontend/app/components/Session/Player/MobilePlayer/MobilePlayerSubheader.tsx b/frontend/app/components/Session/Player/MobilePlayer/MobilePlayerSubheader.tsx index fbb95f28a..c07e903fd 100644 --- a/frontend/app/components/Session/Player/MobilePlayer/MobilePlayerSubheader.tsx +++ b/frontend/app/components/Session/Player/MobilePlayer/MobilePlayerSubheader.tsx @@ -9,11 +9,9 @@ import { Tag } from 'antd' import { ShareAltOutlined } from '@ant-design/icons'; import { Button as AntButton, Popover } from 'antd'; import SharePopup from 'Components/shared/SharePopup/SharePopup'; -import { useStore } from "App/mstore"; function SubHeader(props: any) { - const { issueReportingStore } = useStore() - const integrations = issueReportingStore.list + const integrations = props.integrations; const enabledIntegration = useMemo(() => { if (!integrations || !integrations.length) { @@ -60,5 +58,6 @@ function SubHeader(props: any) { export default connect((state: any) => ({ siteId: state.getIn(['site', 'siteId']), modules: state.getIn(['user', 'account', 'modules']) || [], + integrations: state.getIn(['issues', 'list']), isIOS: state.getIn(['sessions', 'current']).platform === 'ios', }))(observer(SubHeader)); diff --git a/frontend/app/components/Session/Player/MobilePlayer/PlayerBlock.tsx b/frontend/app/components/Session/Player/MobilePlayer/PlayerBlock.tsx index 424a1631b..b3f0c0b04 100644 --- a/frontend/app/components/Session/Player/MobilePlayer/PlayerBlock.tsx +++ b/frontend/app/components/Session/Player/MobilePlayer/PlayerBlock.tsx @@ -22,9 +22,9 @@ function PlayerBlock(props: IProps) { activeTab, fullView = false, setActiveTab, + jiraConfig, } = props; - const { uiPlayerStore, issueReportingStore } = useStore(); - const jiraConfig = issueReportingStore.list[0] + const { uiPlayerStore } = useStore(); const fullscreen = uiPlayerStore.fullscreen; const shouldShowSubHeader = !fullscreen && !fullView return ( @@ -45,4 +45,5 @@ function PlayerBlock(props: IProps) { export default connect((state: any) => ({ sessionId: state.getIn(['sessions', 'current']).sessionId, + jiraConfig: state.getIn(['issues', 'list'])[0], }))(observer(PlayerBlock)) \ No newline at end of file diff --git a/frontend/app/components/Session/Player/ReplayPlayer/PlayerBlock.tsx b/frontend/app/components/Session/Player/ReplayPlayer/PlayerBlock.tsx index e92b6e4c3..a265c1fb8 100644 --- a/frontend/app/components/Session/Player/ReplayPlayer/PlayerBlock.tsx +++ b/frontend/app/components/Session/Player/ReplayPlayer/PlayerBlock.tsx @@ -23,9 +23,9 @@ function PlayerBlock(props: IProps) { activeTab, fullView = false, setActiveTab, + jiraConfig } = props; - const { uiPlayerStore, issueReportingStore } = useStore(); - const jiraConfig = issueReportingStore.list[0] + const { uiPlayerStore, } = useStore(); const fullscreen = uiPlayerStore.fullscreen; const shouldShowSubHeader = !fullscreen && !fullView; return ( @@ -46,4 +46,5 @@ function PlayerBlock(props: IProps) { export default connect((state: Record) => ({ sessionId: state.getIn(['sessions', 'current']).sessionId, +jiraConfig: state.getIn(['issues', 'list'])[0] }))(observer(PlayerBlock)); diff --git a/frontend/app/components/Session_/Issues/Issues.js b/frontend/app/components/Session_/Issues/Issues.js index e85e5d43f..fec61457c 100644 --- a/frontend/app/components/Session_/Issues/Issues.js +++ b/frontend/app/components/Session_/Issues/Issues.js @@ -1,5 +1,5 @@ import { Button, Tooltip } from 'antd'; -import { observer } from 'mobx-react-lite'; +import { connect } from 'react-redux'; import React from 'react'; import { useStore } from 'App/mstore'; import { Icon, Popover } from 'UI'; @@ -7,7 +7,6 @@ import IssuesModal from './IssuesModal'; function Issues(props) { const { issueReportingStore } = useStore(); - const issuesIntegration = issueReportingStore.list const handleOpen = () => { issueReportingStore.init(); @@ -20,8 +19,9 @@ function Issues(props) { } }; - const { sessionId } = props; - const provider = issuesIntegration[0]?.provider || ''; + const { sessionId, issuesIntegration } = props; + const provider = issuesIntegration?.first().provider || ''; + return ( @@ -48,4 +48,7 @@ function Issues(props) { ); } -export default observer(Issues); +export default connect((state) => ({ + issuesIntegration: state.getIn(['issues', 'list']) || {}, + issuesFetched: state.getIn(['issues', 'issuesFetched']), +}))(Issues); \ No newline at end of file diff --git a/frontend/app/components/Session_/Subheader.js b/frontend/app/components/Session_/Subheader.js index a404c4d6d..970963140 100644 --- a/frontend/app/components/Session_/Subheader.js +++ b/frontend/app/components/Session_/Subheader.js @@ -28,9 +28,8 @@ function SubHeader(props) { const { store } = React.useContext(PlayerContext); const { location: currentLocation = 'loading...' } = store.get(); const hasIframe = localStorage.getItem(IFRAME) === 'true'; - const { uxtestingStore, issueReportingStore } = useStore(); + const { uxtestingStore } = useStore(); const [hideTools, setHideTools] = React.useState(false); - const integrations = issueReportingStore.list; React.useEffect(() => { const hideDevtools = checkParam('hideTools'); if (hideDevtools) { @@ -39,6 +38,7 @@ function SubHeader(props) { }, []); const enabledIntegration = useMemo(() => { + const { integrations } = props; if (!integrations || !integrations.size) { return false; } @@ -156,5 +156,6 @@ function SubHeader(props) { export default connect((state) => ({ siteId: state.getIn(['site', 'siteId']), + integrations: state.getIn(['issues', 'list']), modules: state.getIn(['user', 'account', 'modules']) || [] }))(observer(SubHeader));