Dashboard: prevent error when sharing a dashboard. (#33680)

This commit is contained in:
Marcus Andersson 2021-05-05 10:36:42 +02:00 committed by GitHub
parent 578a755cb4
commit 545d930a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,10 +71,10 @@ export class ShareModal extends React.Component<Props, State> {
this.state = getInitialState(props);
}
onDismiss = () => {
this.setState(getInitialState(this.props));
this.props.onDismiss();
};
// onDismiss = () => {
// //this.setState(getInitialState(this.props));
// this.props.onDismiss();
// };
onSelectTab = (t: any) => {
this.setState({ activeTab: t.value });
@ -112,9 +112,9 @@ export class ShareModal extends React.Component<Props, State> {
const ActiveTab = activeTabModel.component;
return (
<Modal isOpen={true} title={this.renderTitle()} onDismiss={this.onDismiss}>
<Modal isOpen={true} title={this.renderTitle()} onDismiss={this.props.onDismiss}>
<TabContent>
<ActiveTab dashboard={dashboard} panel={panel} onDismiss={this.onDismiss} />
<ActiveTab dashboard={dashboard} panel={panel} onDismiss={this.props.onDismiss} />
</TabContent>
</Modal>
);