Fixed querytab corresponding command bar (#1180)

Co-authored-by: sunilyadav <v-yadavsunil@microsoft.com>
This commit is contained in:
Sunil Kumar Yadav 2021-12-28 01:11:42 +05:30 committed by GitHub
parent e61f9f2a38
commit b19144f792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -364,13 +364,11 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
}
public onTabClick(): void {
setTimeout(() => {
if (!this.isCloseClicked) {
useCommandBar.getState().setContextButtons(this.getTabsButtons());
} else {
this.isCloseClicked = false;
}
}, 0);
if (!this.isCloseClicked) {
useCommandBar.getState().setContextButtons(this.getTabsButtons());
} else {
this.isCloseClicked = false;
}
}
public onExecuteQueryClick = async (): Promise<void> => {
@ -875,9 +873,11 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
useCommandBar.getState().setContextButtons(this.getTabsButtons());
}
render(): JSX.Element {
componentDidMount(): void {
useCommandBar.getState().setContextButtons(this.getTabsButtons());
}
render(): JSX.Element {
return (
<Fragment>
<div className="tab-pane" id={this.props.tabId} role="tabpanel">