diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index bbcf069c2..b022b9fe9 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('copayersController', - function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, appConfigService, lodash, profileService, walletService, popupService, bwcError, platformInfo, gettextCatalog, ongoingProcess) { + function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, appConfigService, lodash, profileService, walletService, popupService, bwcError, platformInfo, gettextCatalog, ongoingProcess, pushNotificationsService) { var appName = appConfigService.userVisibleName; var appUrl = appConfigService.url; @@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('copayersController', $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.wallet = profileService.getWallet(data.stateParams.walletId); updateWallet(); + $scope.shareIcon = platformInfo.isIOS ? 'iOS' : 'Android'; }); var listener = $rootScope.$on('bwsEvent', function() { @@ -35,7 +36,12 @@ angular.module('copayApp.controllers').controller('copayersController', if (status.wallet.status == 'complete') { $scope.wallet.openWallet(function(err, status) { if (err) $log.error(err); - $scope.goHome(); + $scope.clearNextView(); + $state.go('tabs.home').then(function() { + $state.transitionTo('tabs.wallet', { + walletId: $scope.wallet.credentials.walletId + }); + }); }); } }); @@ -56,7 +62,9 @@ angular.module('copayApp.controllers').controller('copayersController', if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err.message || err); } else { - $scope.goHome(); + pushNotificationsService.unsubscribe($scope.wallet); + $scope.clearNextView(); + $state.go('tabs.home'); } }); }; @@ -81,9 +89,12 @@ angular.module('copayApp.controllers').controller('copayersController', } }; - $scope.goHome = function() { - $state.go('tabs.home'); - $ionicHistory.clearHistory(); + $scope.clearNextView = function() { + $ionicHistory.nextViewOptions({ + disableAnimate: true, + historyRoot: true + }); + $ionicHistory.clearHistory(); }; }); diff --git a/src/sass/variables.scss b/src/sass/variables.scss index d91baa647..5481aace9 100644 --- a/src/sass/variables.scss +++ b/src/sass/variables.scss @@ -24,6 +24,7 @@ $v-text-accent-color: #647ce8 !default; $v-success-color: #13e5b6 !default; $v-warning-color: #ffa500 !default; +$v-error-color: #ef473a !default; $v-wallet-color-map: ( 0: (color: #dd4b39, name: 'Cinnabar'), diff --git a/src/sass/views/copayers.scss b/src/sass/views/copayers.scss index 2f3458a4e..6dabb8758 100644 --- a/src/sass/views/copayers.scss +++ b/src/sass/views/copayers.scss @@ -1,13 +1,37 @@ -.copayers-secret { - text-align: center; - font-size: 12px; - margin: 10px; - white-space: -moz-pre-wrap !important; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - white-space: pre-wrap; - word-wrap: break-word; - white-space: -webkit-pre-wrap; - word-break: break-all; - white-space: normal; +#copayers-invitation { + @extend .deflash-blue; + .button-share { + color: #fff; + box-shadow: none; + border-color: transparent; + background: transparent; + padding: 0 10px; + .icon:before { + font-size: 26px; + } + } + .button-cancel { + margin-top: 15px; + background: transparent; + border: none; + font-size: 12px; + color: $v-error-color; + i.icon { + vertical-align: middle; + padding-left: 5px; + } + } + .copayers-secret { + text-align: center; + font-size: 12px; + margin: 10px; + white-space: -moz-pre-wrap !important; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + white-space: pre-wrap; + word-wrap: break-word; + white-space: -webkit-pre-wrap; + word-break: break-all; + white-space: normal; + } } diff --git a/www/views/copayers.html b/www/views/copayers.html index a3b4ff52c..c575d0e0b 100644 --- a/www/views/copayers.html +++ b/www/views/copayers.html @@ -1,19 +1,23 @@ - + {{wallet.name}} -
-
+
Share this invitation with your copayers
@@ -29,11 +33,8 @@ {{secret || ('Loading...'|translate)}}
-