diff --git a/plugin.json b/plugin.json index 3474f71b..26a97312 100644 --- a/plugin.json +++ b/plugin.json @@ -5,7 +5,7 @@ "homepage_url": "https://github.com/mattermost/mattermost-plugin-jira", "support_url": "https://github.com/mattermost/mattermost-plugin-jira/issues", "icon_path": "assets/icon.svg", - "min_server_version": "7.8.0", + "min_server_version": "10.5.0", "server": { "executables": { "darwin-amd64": "server/dist/plugin-darwin-amd64", diff --git a/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx b/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx index f50f4871..cdc06b66 100644 --- a/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx +++ b/webapp/src/components/jira_ticket_tooltip/jira_ticket_tooltip.tsx @@ -81,22 +81,21 @@ export default class TicketPopover extends React.PureComponent { return null; }; - componentDidUpdate() { + componentDidMount() { const issueKey = this.getIssueKey(); if (!issueKey) { return; } const {instanceID} = issueKey; - const {ticketId, ticketDetails} = this.state; - if (!ticketDetails && this.props.show && ticketId) { - this.props.fetchIssueByKey(this.state.ticketId, instanceID).then((res: { data?: TicketData; error?: any}) => { + if (this.props.show && this.state.ticketId && !this.state.ticketDetails) { + this.props.fetchIssueByKey(this.state.ticketId, instanceID).then((res: {data?: TicketData, error?: any}) => { if (res.error) { this.setState({error: 'There was a problem loading the details for this Jira link'}); return; } const updatedTicketDetails = getJiraTicketDetails(res.data); - if (this.props.connected && updatedTicketDetails && updatedTicketDetails.ticketId === ticketId) { + if (this.props.connected && updatedTicketDetails && updatedTicketDetails.ticketId === this.state.ticketId) { this.setState({ ticketDetails: updatedTicketDetails, error: null,