From 7bb61e100f1f9d6a8246b13171ed4402e73df68c Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Wed, 29 Aug 2018 01:41:28 +0300 Subject: [PATCH] fix(top): fix top tab redraw bug regression in v0.29.3 --- src/app/pages-pie.js | 47 ++++++++++++++++++++++++++------------------ src/app/top-page.js | 6 +++++- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/app/pages-pie.js b/src/app/pages-pie.js index 88261a8..d337854 100644 --- a/src/app/pages-pie.js +++ b/src/app/pages-pie.js @@ -12,26 +12,35 @@ class PagesPie extends Component { if (params.replace === 'last') { this.pie.pop(); } - this.forceUpdate(); delete params.replace; } - setTimeout(() => { - if (Array.isArray(pages)) { - for (let i in pages) { - this.pie.push({ - Page: pages[i], - params: params - }); - } - } else { - this.pie.push({ - Page: pages, - params: params - }); - } - this.forceUpdate(); - }, 0); - } + if (Array.isArray(pages)) { + for (let i in pages) { + this.pie.push({ + Page: pages[i], + params: params + }); + } + } else { + this.pie.push({ + Page: pages, + params: params + }); + } + if(this._mounted) + this.forceUpdate() + } + + componentWillMount() + { + this._mounted = true + } + + componentWillUnmount() + { + this._mounted = false + } + close(count) { if (count && typeof count === 'number') { for (let i = 0; i < count; i++) { @@ -50,7 +59,7 @@ class PagesPie extends Component { } // ОТРИСОВКА render() { - if (this.pie.length > 0) { + if (this.pie.length > 0) { return (