diff options
author | Mark Stacey <markjstacey@gmail.com> | 2019-07-12 23:41:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 23:41:39 +0800 |
commit | 2eea38868081d5e1d87b70712253cceb750f2011 (patch) | |
tree | 9364fe770c15f45ae6b9d51a8ae299eba2b74fab /ui/app/store/actions.js | |
parent | 830c801ec39ee5dc878b1a08d7241d96bba0b6d6 (diff) | |
download | tangerine-wallet-browser-2eea38868081d5e1d87b70712253cceb750f2011.tar.gz tangerine-wallet-browser-2eea38868081d5e1d87b70712253cceb750f2011.tar.zst tangerine-wallet-browser-2eea38868081d5e1d87b70712253cceb750f2011.zip |
Remove unused expressions (#6839)
Unused expressions are generally a mistake, as they don't do anything.
The exceptions to this rule (short-circuit expressions and ternary
expressions) have been allowed.
The `webrtc-adapter` was previously ignored by eslint because it has a
side-effect upon being imported. I removed the local variable instead,
which should preserve the same side-effect without making eslint
complain.
Diffstat (limited to 'ui/app/store/actions.js')
-rw-r--r-- | ui/app/store/actions.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index c9e595421..634e6c058 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -1476,7 +1476,9 @@ function cancelAllTx (txsData) { txsData.forEach((txData, i) => { background.cancelTransaction(txData.id, () => { dispatch(actions.completedTx(txData.id)) - i === txsData.length - 1 ? dispatch(actions.goHome()) : null + if (i === txsData.length - 1) { + dispatch(actions.goHome()) + } }) }) } @@ -2394,18 +2396,21 @@ function reshowQrCode (data, coin) { } } -function shapeShiftRequest (query, options, cb) { +function shapeShiftRequest (query, options = {}, cb) { var queryResponse, method - !options ? options = {} : null options.method ? method = options.method : method = 'GET' var requestListner = function () { try { queryResponse = JSON.parse(this.responseText) - cb ? cb(queryResponse) : null + if (cb) { + cb(queryResponse) + } return queryResponse } catch (e) { - cb ? cb({error: e}) : null + if (cb) { + cb({error: e}) + } return e } } |