Skip to content

Commit

Permalink
[MM-62462] Plugin link tooltip for Jira plugin opens takes a very lon…
Browse files Browse the repository at this point in the history
…g time to load (#1145)
  • Loading branch information
M-ZubairAhmed authored Jan 16, 2025
1 parent b9064ce commit 3b40b93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,21 @@ export default class TicketPopover extends React.PureComponent<Props, State> {
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,
Expand Down

0 comments on commit 3b40b93

Please sign in to comment.