diff --git a/packages/app/src/components/PagePanels/index.jsx b/packages/app/src/components/PagePanels/index.jsx
index 5c37228b..8eb03a0b 100755
--- a/packages/app/src/components/PagePanels/index.jsx
+++ b/packages/app/src/components/PagePanels/index.jsx
@@ -124,16 +124,20 @@ export class PagePanelWithNavMenu extends React.Component {
app.history.replace(`${window.location.pathname}?type=${this.state.activeTab}`)
}
- tabChange = (key) => {
- if (this.props.onTabChange) {
- this.props.onTabChange(key)
+ tabChange = async (key) => {
+ if (this.props.beforeTabChange) {
+ await this.props.beforeTabChange(key)
}
- this.setState({ activeTab: key })
+ await this.setState({ activeTab: key })
if (this.props.useSetQueryType) {
this.replaceQueryTypeToCurrentTab()
}
+
+ if (this.props.onTabChange) {
+ this.props.onTabChange(key)
+ }
}
handleTabChange = async (key) => {
@@ -230,6 +234,8 @@ export class PagePanelWithNavMenu extends React.Component {