diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 892288ca..66e9ed43 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -48,6 +48,7 @@ class NewHeader extends Component { mygetHelmetapi2: null, goshowqqgtounp: false, visiblemyss: false, + navbar: [] } } componentDidMount() { @@ -536,6 +537,11 @@ class NewHeader extends Component { this.setState({ mygetHelmetapi2: chromesettingArray }); + if (mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.length) { + this.setState({ navbar: mygetHelmetapi2.navbar.sort((a, b) => {return a.index - b.index}) }, () => { + console.log(''); + }); + } if (chromesettingArray.tab_logo_url) { this.gettablogourldata(chromesettingresponseArray); } else { @@ -553,6 +559,11 @@ class NewHeader extends Component { this.setState({ mygetHelmetapi2: response.data.setting }, () => { console.log(''); }); + if (response.data.setting.navbar && response.data.setting.navbar.length) { + this.setState({ navbar: response.data.setting.navbar.sort((a, b) => {return a.index - b.index}) }, () => { + console.log(''); + }); + } // localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); // localStorage.setItem('chromesettingresponse', JSON.stringify(response)); try { @@ -633,6 +644,7 @@ class NewHeader extends Component { isRender, mygetHelmetapi2, goshowqqgtounp, + navbar } = this.state; const filterPersonal = mygetHelmetapi2 && mygetHelmetapi2.personal && mygetHelmetapi2.personal.filter(i=>i.key === "userinfo"); @@ -668,10 +680,10 @@ class NewHeader extends Component {