Skip to content

Commit

Permalink
Fix POST URL copying as we've moved from static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Griffith committed Mar 16, 2020
1 parent 6ad3dac commit 210d627
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ReportingPanelContentUi extends Component<Props, State> {

this.state = {
isStale: false,
absoluteUrl: '',
absoluteUrl: this.getAbsoluteReportGenerationUrl(props),
layoutId: '',
};
}
Expand All @@ -53,15 +53,15 @@ class ReportingPanelContentUi extends Component<Props, State> {
return url.resolve(window.location.href, relativePath);
};

public getDerivedStateFromProps = (nextProps: Props, prevState: State) => {
if (nextProps.layoutId !== prevState.layoutId) {
return {
public componentDidUpdate(prevProps: Props, prevState: State) {
if (this.props.layoutId !== prevState.layoutId) {
this.setState({
...prevState,
absoluteUrl: this.getAbsoluteReportGenerationUrl(nextProps),
};
absoluteUrl: this.getAbsoluteReportGenerationUrl(this.props),
layoutId: this.props.layoutId,
});
}
return prevState;
};
}

public componentWillUnmount() {
window.removeEventListener('hashchange', this.markAsStale);
Expand Down

0 comments on commit 210d627

Please sign in to comment.