This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix extension detection #6452
Merged
Merged
Fix extension detection #6452
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b789ed9
Fix extension detection.
tomusdrw 5ccd52e
Merge branch 'master' into td-extension-fixes
tomusdrw f760549
Merge branch 'master' into td-extension-fixes
tomusdrw c73efb4
Merge branch 'master' into td-extension-fixes
tomusdrw aa47770
Fix mobx quirks.
tomusdrw d47b2d7
Update submodule.
tomusdrw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
height: 100%; | ||
position: relative; | ||
width: 100%; | ||
max-width: 100%; | ||
|
||
&:hover { | ||
filter: none; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,19 +60,27 @@ export default class Store { | |
} | ||
|
||
@action testInstall = () => { | ||
this.shouldInstall = this.readStatus(); | ||
this.readStatus() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MobX sometimes does things a bit funny when dealing with promises, i.e. not firing updates when inside a promise chain. Generally it would be preferable to...
|
||
.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 = () => { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes display of accounts on firefox (especially in Parity Bar when selecting default account, the accounts were overlapping).