From b789ed9de014bdb7c1eddb3ec4ef45bf2b26b7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Fri, 1 Sep 2017 18:38:44 +0200 Subject: [PATCH 1/3] Fix extension detection. --- js/src/ui/SelectionList/selectionList.css | 1 + js/src/views/Application/Extension/store.js | 28 +++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/js/src/ui/SelectionList/selectionList.css b/js/src/ui/SelectionList/selectionList.css index b6e6b05f9fd..73721e54ac8 100644 --- a/js/src/ui/SelectionList/selectionList.css +++ b/js/src/ui/SelectionList/selectionList.css @@ -22,6 +22,7 @@ height: 100%; position: relative; width: 100%; + max-width: 100%; &:hover { filter: none; diff --git a/js/src/views/Application/Extension/store.js b/js/src/views/Application/Extension/store.js index d1df2eb5b65..bfdc6795b1b 100644 --- a/js/src/views/Application/Extension/store.js +++ b/js/src/views/Application/Extension/store.js @@ -60,19 +60,27 @@ export default class Store { } @action testInstall = () => { - this.shouldInstall = this.readStatus(); + this.readStatus() + .then(status => { + this.shouldInstall = status; + }); } readStatus = () => { - const hasExtension = Symbol.for('parity.extension') in window; - const ua = browser.analyze(navigator.userAgent || ''); - - if (hasExtension) { - this.setExtensionActive(); - return false; - } - - return (ua || {}).name.toLowerCase() === 'chrome'; + return new Promise((resolve, reject) => { + // Defer checking for the extension since it may not have loaded yet. + setTimeout(() => { + const hasExtension = Symbol.for('parity.extension') in window; + const ua = browser.analyze(navigator.userAgent || ''); + + if (hasExtension) { + this.setExtensionActive(); + return resolve(false); + } + + return resolve((ua || {}).name.toLowerCase() === 'chrome'); + }, 5000); + }); } installExtension = () => { From aa477707f6798e2c0bc9f65d071dbd05e173eaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 13 Sep 2017 13:49:46 +0200 Subject: [PATCH 2/3] Fix mobx quirks. --- ethcore/res/wasm-tests | 2 +- js/src/views/Application/Extension/store.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ethcore/res/wasm-tests b/ethcore/res/wasm-tests index 5fd27564f1a..9ed6304313f 160000 --- a/ethcore/res/wasm-tests +++ b/ethcore/res/wasm-tests @@ -1 +1 @@ -Subproject commit 5fd27564f1ab49b25bb419bfc0cc68137e1f12f2 +Subproject commit 9ed6304313fa949ed92aa0570fb2bc759fb6dc58 diff --git a/js/src/views/Application/Extension/store.js b/js/src/views/Application/Extension/store.js index bfdc6795b1b..af4b1a20534 100644 --- a/js/src/views/Application/Extension/store.js +++ b/js/src/views/Application/Extension/store.js @@ -39,7 +39,6 @@ export default class Store { constructor () { this.nextDisplay = store.get(NEXT_DISPLAY) || 0; - this.testInstall(); } @computed get showWarning () { @@ -59,11 +58,12 @@ export default class Store { store.set(NEXT_DISPLAY, this.nextDisplay); } - @action testInstall = () => { - this.readStatus() - .then(status => { - this.shouldInstall = status; - }); + @action setShouldInstall = (status) => { + this.shouldInstall = status; + } + + testInstall = () => { + this.readStatus().then(this.setShouldInstall); } readStatus = () => { From d47b2d7ebda22ac0ba9578b71a71ab6aa01ccce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 13 Sep 2017 17:13:59 +0200 Subject: [PATCH 3/3] Update submodule. --- ethcore/res/wasm-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/res/wasm-tests b/ethcore/res/wasm-tests index 9ed6304313f..5fd27564f1a 160000 --- a/ethcore/res/wasm-tests +++ b/ethcore/res/wasm-tests @@ -1 +1 @@ -Subproject commit 9ed6304313fa949ed92aa0570fb2bc759fb6dc58 +Subproject commit 5fd27564f1ab49b25bb419bfc0cc68137e1f12f2