diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index 877c8a85d..7a0b6378c 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -20,7 +20,7 @@ -
+

@@ -67,10 +67,14 @@
Buy - ${{buy.buyPrice.subtotal}} {{buy.buyPrice.currency}} in Bitcoin + {{buy.buyPrice.currency}} {{buy.buyPrice.subtotal}} in Bitcoin {{buy.buyPrice.qty}} BTC - at ${{buy.buyPrice.price}} {{buy.buyPrice.currency}} + at {{buy.buyPrice.price}} {{buy.buyPrice.currency}}/BTC
+
+ (Enter the amount to get the exchange rate) +
+
-

- ${{buy.buyPrice.price}} {{buy.buyPrice.currency}} will be immediately withdrawn from your - bank account. The total of {{buy.buyPrice.qty}} BTC will be purchased and deposited to your bitcoin wallet ({{index.walletName}}) in 2-4 business days. -

-

- A SMS containing a confirmation code was sent to your phone. Please, enter code below -

-
- - - -
+
+ {{buy.buyPrice.currency}} {{buy.buyPrice.subtotal}} → {{buy.buyPrice.qty}} BTC +

+ A SMS containing a confirmation code was sent to your phone.
+ Please, enter the code below +

+
+ + +
+

+ Fiat will be immediately withdrawn from your bank account. The bitcoins will be purchased and deposited to your bitcoin wallet ({{index.walletName}}) in 2-4 business days. +

+
diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index f427c2504..19b08a333 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -20,7 +20,7 @@

-
+

@@ -28,11 +28,11 @@
Daily sell limit: ${{index.glideraLimits.dailySell}} - (remaining ${{index.glideraLimits.dailySellRemaining}}) + (${{index.glideraLimits.dailySellRemaining}} remaining)
Monthly sell limit: ${{index.glideraLimits.monthlySell}} - (remaining ${{index.glideraLimits.monthlySellRemaining}}) + (${{index.glideraLimits.monthlySellRemaining}} remaining)

@@ -67,11 +67,14 @@
Sell - ${{sell.sellPrice.subtotal}} {{sell.sellPrice.currency}} in Bitcoin + {{sell.sellPrice.currency}} {{sell.sellPrice.subtotal}} in Bitcoin {{sell.sellPrice.qty}} BTC - at ${{sell.sellPrice.price}} {{sell.sellPrice.currency}} + at {{sell.sellPrice.price}} {{sell.sellPrice.currency}}/BTC + +
+
+ (Enter the amount to get the exchange rate)
-
-

- {{sell.sellPrice.qty}} BTC will be immediately sent from your wallet to Glidera. The total of ${{sell.sellPrice.subtotal}} {{sell.sellPrice.currency}} will be deposited in your bank account in 4-6 business days. -

-

- A SMS containing a confirmation code was sent to your phone. Please, enter code below -

-
- - - -
+
+{{sell.sellPrice.qty}} BTC → {{sell.sellPrice.currency}} {{sell.sellPrice.subtotal}} +

+ A SMS containing a confirmation code was sent to your phone.
+ Please, enter the code below +

+
+ + +
+

+ Bitcoins will be immediately sent from your wallet to Glidera. Fiat will be deposited in your bank account in 4-6 business days. +

+
@@ -109,7 +115,6 @@
-
diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js index fb05a438b..eac8576a7 100644 --- a/src/js/controllers/buyGlidera.js +++ b/src/js/controllers/buyGlidera.js @@ -69,7 +69,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController', } else { self.success = data; - $scope.$emit('Local/GlideraUpdated', token, permissions); + $scope.$emit('Local/GlideraTx'); } }); }, 100); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index c0217b507..acdc7c826 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -863,15 +863,19 @@ console.log('[index.js:395]',txps); //TODO else { self.glideraToken = accessToken; self.glideraPermissions = p; - self.updateGlidera(accessToken, p); + self.updateGlidera({ fullUpdate: true}); } }); } }); }; - self.updateGlidera = function(accessToken, permissions) { - if (!accessToken || !permissions) return; + self.updateGlidera = function(opts) { + if (!self.glideraToken || !self.glideraPermissions) return; + var accessToken = self.glideraToken; + var permissions = self.glideraPermissions; + + opts = opts || {}; glideraService.getStatus(accessToken, function(err, data) { self.glideraStatus = data; @@ -880,21 +884,7 @@ console.log('[index.js:395]',txps); //TODO glideraService.getLimits(accessToken, function(err, limits) { self.glideraLimits = limits; }); - - if (permissions.view_email_address) { - self.glideraLoadingEmail = gettext('Getting Glidera Email...'); - glideraService.getEmail(accessToken, function(err, data) { - self.glideraLoadingEmail = null; - self.glideraEmail = data.email; - }); - } - if (permissions.personal_info) { - self.glideraLoadingPersonalInfo = gettext('Getting Glidera Personal Information...'); - glideraService.getPersonalInfo(accessToken, function(err, data) { - self.glideraLoadingPersonalInfo = null; - self.glideraPersonalInfo = data; - }); - } + if (permissions.transaction_history) { self.glideraLoadingHistory = gettext('Getting Glidera transactions...'); glideraService.getTransactions(accessToken, function(err, data) { @@ -902,6 +892,22 @@ console.log('[index.js:395]',txps); //TODO self.glideraTxs = data; }); } + + if (permissions.view_email_address && opts.fullUpdate) { + self.glideraLoadingEmail = gettext('Getting Glidera Email...'); + glideraService.getEmail(accessToken, function(err, data) { + self.glideraLoadingEmail = null; + self.glideraEmail = data.email; + }); + } + if (permissions.personal_info && opts.fullUpdate) { + self.glideraLoadingPersonalInfo = gettext('Getting Glidera Personal Information...'); + glideraService.getPersonalInfo(accessToken, function(err, data) { + self.glideraLoadingPersonalInfo = null; + self.glideraPersonalInfo = data; + }); + } + }; // UX event handlers @@ -957,8 +963,8 @@ console.log('[index.js:395]',txps); //TODO self.initGlidera(accessToken); }); - $rootScope.$on('Local/GlideraUpdated', function(event, accessToken, permissions) { - self.updateGlidera(accessToken, permissions); + $rootScope.$on('Local/GlideraTx', function(event, accessToken, permissions) { + self.updateGlidera(); }); $rootScope.$on('Local/GlideraError', function(event) { @@ -1063,7 +1069,7 @@ console.log('[index.js:395]',txps); //TODO }); lodash.each(['NewTxProposal', 'TxProposalFinallyRejected', 'TxProposalRemoved', - 'Local/NewTxProposal', 'Local/TxProposalAction', 'ScanFinished' + 'Local/NewTxProposal', 'Local/TxProposalAction', 'ScanFinished', 'Local/GlideraTx' ], function(eventName) { $rootScope.$on(eventName, function(event, untilItChanges) { self.updateAll({ diff --git a/src/js/controllers/sellGlidera.js b/src/js/controllers/sellGlidera.js index 77b5e5a0b..998c57b32 100644 --- a/src/js/controllers/sellGlidera.js +++ b/src/js/controllers/sellGlidera.js @@ -121,7 +121,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController', } else { self.success = data; - $scope.$emit('Local/GlideraUpdated', token, permissions); + $scope.$emit('Local/GlideraTx'); } }); }