aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/provider-approval.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-11-05 21:07:56 +0800
committerDan Finlay <542863+danfinlay@users.noreply.github.com>2018-11-06 07:07:09 +0800
commit26ada8a828ab684c310080a18115a8ef3234aaee (patch)
tree5590e696390208691d61b5bdf82b80a9fe1ad27d /app/scripts/controllers/provider-approval.js
parent31cb111d2e98c17728a75ebe00430654d827e136 (diff)
downloadtangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar.gz
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar.bz2
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar.lz
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar.xz
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.tar.zst
tangerine-wallet-browser-26ada8a828ab684c310080a18115a8ef3234aaee.zip
Update Connect Request screen design (#5644)
* Parameterize NetworkDisplay background colour * Update design for login request screen * Pass siteTitle, siteImage through for calls to ethereum.enable() * Bring the site images closer together
Diffstat (limited to 'app/scripts/controllers/provider-approval.js')
-rw-r--r--app/scripts/controllers/provider-approval.js40
1 files changed, 22 insertions, 18 deletions
diff --git a/app/scripts/controllers/provider-approval.js b/app/scripts/controllers/provider-approval.js
index 728361c79..f2d40e67d 100644
--- a/app/scripts/controllers/provider-approval.js
+++ b/app/scripts/controllers/provider-approval.js
@@ -24,31 +24,35 @@ class ProviderApprovalController {
this.publicConfigStore = publicConfigStore
this.store = new ObservableStore()
- platform && platform.addMessageListener && platform.addMessageListener(({ action = '', origin }) => {
- switch (action) {
- case 'init-provider-request':
- this._handleProviderRequest(origin)
- break
- case 'init-is-approved':
- this._handleIsApproved(origin)
- break
- case 'init-is-unlocked':
- this._handleIsUnlocked()
- break
- case 'init-privacy-request':
- this._handlePrivacyRequest()
- break
- }
- })
+ if (platform && platform.addMessageListener) {
+ platform.addMessageListener(({ action = '', origin, siteTitle, siteImage }) => {
+ switch (action) {
+ case 'init-provider-request':
+ this._handleProviderRequest(origin, siteTitle, siteImage)
+ break
+ case 'init-is-approved':
+ this._handleIsApproved(origin)
+ break
+ case 'init-is-unlocked':
+ this._handleIsUnlocked()
+ break
+ case 'init-privacy-request':
+ this._handlePrivacyRequest()
+ break
+ }
+ })
+ }
}
/**
* Called when a tab requests access to a full Ethereum provider API
*
* @param {string} origin - Origin of the window requesting full provider access
+ * @param {string} siteTitle - The title of the document requesting full provider access
+ * @param {string} siteImage - The icon of the window requesting full provider access
*/
- _handleProviderRequest (origin) {
- this.store.updateState({ providerRequests: [{ origin }] })
+ _handleProviderRequest (origin, siteTitle, siteImage) {
+ this.store.updateState({ providerRequests: [{ origin, siteTitle, siteImage }] })
const isUnlocked = this.keyringController.memStore.getState().isUnlocked
if (this.isApproved(origin) && this.caching && isUnlocked) {
this.approveProviderRequest(origin)