From d1bada84d2247c9327294525766840513f16dc2f Mon Sep 17 00:00:00 2001 From: Andre Pimenta Date: Wed, 10 Jun 2020 21:15:23 +0100 Subject: [PATCH] Fix browser intial load (#1623) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix browser intial load * Fix unit testing Co-authored-by: Esteban MiƱo --- .../__snapshots__/index.test.js.snap | 40 +------------------ app/components/Views/BrowserTab/index.js | 11 +---- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/app/components/Views/BrowserTab/__snapshots__/index.test.js.snap b/app/components/Views/BrowserTab/__snapshots__/index.test.js.snap index a282f7539f6..c0122cda94f 100644 --- a/app/components/Views/BrowserTab/__snapshots__/index.test.js.snap +++ b/app/components/Views/BrowserTab/__snapshots__/index.test.js.snap @@ -19,45 +19,7 @@ exports[`Browser should render correctly 1`] = ` "zIndex": 1, } } - > - - + /> { + forceReload = () => { this.isReloading = true; this.toggleOptionsIfNeeded(); @@ -1133,13 +1133,6 @@ export class BrowserTab extends PureComponent { this.approvalRequest = undefined; const url2Reload = this.state.inputValue; - // If it is the first time the component is being mounted, there should be no cache problem and no need for remounting the component - if (initialReload) { - this.isReloading = false; - this.go(url2Reload); - return; - } - // Force unmount the webview to avoid caching problems this.setState({ forceReload: true }, () => { // Make sure we're not calling last mounted webview during this time threshold @@ -1157,7 +1150,7 @@ export class BrowserTab extends PureComponent { if (this.webview && this.webview.current) { this.webview.current.stopLoading(); } - this.forceReload(true); + this.forceReload(); this.init(); };