diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-04 06:57:23 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-04 06:57:23 +0800 |
commit | 71ef4d85da50c50f767e20623fd30c014ba16ecf (patch) | |
tree | d10e0de00e43bde10f59c741a38df93cffd95806 /ui/lib | |
parent | 94a89790dcca3003fde59e8385b8c3d32f36d466 (diff) | |
download | tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar.gz tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar.bz2 tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar.lz tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar.xz tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.tar.zst tangerine-wallet-browser-71ef4d85da50c50f767e20623fd30c014ba16ecf.zip |
design complete
Diffstat (limited to 'ui/lib')
-rw-r--r-- | ui/lib/webcam-utils.js | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/ui/lib/webcam-utils.js b/ui/lib/webcam-utils.js index 9b507cd99..b1609ff4a 100644 --- a/ui/lib/webcam-utils.js +++ b/ui/lib/webcam-utils.js @@ -8,28 +8,29 @@ class WebcamUtils { static checkStatus () { return new Promise((resolve, reject) => { - const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP - const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 - const isBrave = !!window.chrome.ipcRenderer - const isFirefoxOrBrave = isFirefox || isBrave - try { - DetectRTC.load(_ => { - if (DetectRTC.hasWebcam) { - let environmentReady = true - if ((isFirefoxOrBrave && isPopup) || (isPopup && !DetectRTC.isWebsiteHasWebcamPermissions)) { - environmentReady = false - } - resolve({ - permissions: DetectRTC.isWebsiteHasWebcamPermissions, - environmentReady, - }) - } else { - reject({type: 'NO_WEBCAM_FOUND'}) - } - }) - } catch (e) { - reject({type: 'UNKNOWN_ERROR'}) - } + reject({type: 'UNKNOWN_ERROR'}) + // const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP + // const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 + // const isBrave = !!window.chrome.ipcRenderer + // const isFirefoxOrBrave = isFirefox || isBrave + // try { + // DetectRTC.load(_ => { + // if (DetectRTC.hasWebcam) { + // let environmentReady = true + // if ((isFirefoxOrBrave && isPopup) || (isPopup && !DetectRTC.isWebsiteHasWebcamPermissions)) { + // environmentReady = false + // } + // resolve({ + // permissions: DetectRTC.isWebsiteHasWebcamPermissions, + // environmentReady, + // }) + // } else { + // reject({type: 'NO_WEBCAM_FOUND'}) + // } + // }) + // } catch (e) { + // reject({type: 'UNKNOWN_ERROR'}) + // } }) } } |