aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2017-12-23 02:43:02 +0800
committerGitHub <noreply@github.com>2017-12-23 02:43:02 +0800
commita218008adf85dfb5fa8ca93c789e14d9f2090813 (patch)
tree863dd34eed719074277a8c65397d9e5081b2084b /ui/app/actions.js
parent4acd48966edf2e6cf4ced6e3e0983a44dcb2ec13 (diff)
downloadtangerine-wallet-browser-a218008adf85dfb5fa8ca93c789e14d9f2090813.tar.gz
tangerine-wallet-browser-a218008adf85dfb5fa8ca93c789e14d9f2090813.tar.zst
tangerine-wallet-browser-a218008adf85dfb5fa8ca93c789e14d9f2090813.zip
Track usage of old and new UI (#2794)
[NewUI] Track usage of old and new UI
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js37
1 files changed, 33 insertions, 4 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index e8271c9a7..bd3aab45a 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -240,12 +240,17 @@ var actions = {
SET_USE_BLOCKIE: 'SET_USE_BLOCKIE',
setUseBlockie,
-
+
// Feature Flags
setFeatureFlag,
updateFeatureFlags,
UPDATE_FEATURE_FLAGS: 'UPDATE_FEATURE_FLAGS',
-
+
+ // Network
+ setNetworkEndpoints,
+ updateNetworkEndpointType,
+ UPDATE_NETWORK_ENDPOINT_TYPE: 'UPDATE_NETWORK_ENDPOINT_TYPE',
+
retryTransaction,
}
@@ -1489,7 +1494,7 @@ function reshowQrCode (data, coin) {
dispatch(actions.showLoadingIndication())
shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => {
if (mktResponse.error) return dispatch(actions.displayWarning(mktResponse.error))
-
+
var message = [
`Deposit your ${coin} to the address bellow:`,
`Deposit Limit: ${mktResponse.limit}`,
@@ -1565,7 +1570,7 @@ function setFeatureFlag (feature, activated, notificationType) {
dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.displayWarning(err.message))
- reject(err)
+ return reject(err)
}
dispatch(actions.updateFeatureFlags(updatedFeatureFlags))
notificationType && dispatch(actions.showModal({ name: notificationType }))
@@ -1646,3 +1651,27 @@ function setUseBlockie (val) {
})
}
}
+
+function setNetworkEndpoints (networkEndpointType) {
+ return dispatch => {
+ log.debug('background.setNetworkEndpoints')
+ return new Promise((resolve, reject) => {
+ background.setNetworkEndpoints(networkEndpointType, err => {
+ if (err) {
+ dispatch(actions.displayWarning(err.message))
+ return reject(err)
+ }
+
+ dispatch(actions.updateNetworkEndpointType(networkEndpointType))
+ resolve(networkEndpointType)
+ })
+ })
+ }
+}
+
+function updateNetworkEndpointType (networkEndpointType) {
+ return {
+ type: actions.UPDATE_NETWORK_ENDPOINT_TYPE,
+ value: networkEndpointType,
+ }
+}