diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-24 09:27:51 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-24 09:27:51 +0800 |
commit | f7ad978474f42eb96f4f6c79376391504cf228c1 (patch) | |
tree | be472127595385f8c8558213a58b7d1a470ad760 /ui/app/actions.js | |
parent | 02091486094dcc818096ce13a22cdc140a2e8347 (diff) | |
download | tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.gz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.bz2 tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.lz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.xz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.zst tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.zip |
camera working back and forth
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 6c947fc35..9aba6853d 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -302,6 +302,7 @@ var actions = { CLEAR_PENDING_TOKENS: 'CLEAR_PENDING_TOKENS', setPendingTokens, clearPendingTokens, + scanQrCode, } module.exports = actions @@ -2194,3 +2195,23 @@ function clearPendingTokens () { type: actions.CLEAR_PENDING_TOKENS, } } + +function scanQrCode () { + log.debug(`background.scanQrCode`) + return (dispatch, getState) => { + dispatch(actions.showLoadingIndication()) + return new Promise((resolve, reject) => { + background.scanQrCode((err, data) => { + log.debug(`background.scanQrCode resolved!`, err, data) + if (err) { + log.error(err) + dispatch(actions.displayWarning(err.message)) + return reject(err) + } + + dispatch(actions.hideLoadingIndication()) + return resolve(data) + }) + }) + } +} |