From a9ea9e985a09cbca720c2a1087ca9084aacfebb6 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Tue, 2 May 2017 14:59:33 +0200 Subject: [PATCH 1/3] Fix new account generation cancel action --- src/app/components/login/passphrase.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/login/passphrase.js b/src/app/components/login/passphrase.js index 747818fdf..c9c8e562b 100644 --- a/src/app/components/login/passphrase.js +++ b/src/app/components/login/passphrase.js @@ -27,9 +27,10 @@ app.directive('passphrase', ($rootScope, $document, Passphrase, $mdDialog, $mdMe $mdDialog.show({ controllerAs: '$ctrl', controller: /* @ngInject*/ class save { - constructor($scope) { + constructor($scope, $state) { this.$mdDialog = $mdDialog; this.passphrase = passphrase; + this.$state = $state; $scope.$watch('$ctrl.missing_input', () => { this.missing_ok = this.missing_input && this.missing_input === this.missing_word; @@ -54,6 +55,7 @@ app.directive('passphrase', ($rootScope, $document, Passphrase, $mdDialog, $mdMe close() { this.$mdDialog.hide(); + this.$state.reload(); } }, From 4c7f6d45ac2d839e681ed16955f39afb232e3389 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Tue, 2 May 2017 15:01:08 +0200 Subject: [PATCH 2/3] Make passphrase dialog look nicer --- src/app/components/login/passphrase.js | 2 +- src/app/components/login/save.less | 16 ---------------- src/app/components/login/save.pug | 6 +++--- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/app/components/login/passphrase.js b/src/app/components/login/passphrase.js index c9c8e562b..b0a8450e7 100644 --- a/src/app/components/login/passphrase.js +++ b/src/app/components/login/passphrase.js @@ -60,7 +60,7 @@ app.directive('passphrase', ($rootScope, $document, Passphrase, $mdDialog, $mdMe }, template: require('./save.pug')(), - fullscreen: ($mdMedia('sm') || $mdMedia('xs')) && this.scope.customFullscreen, + fullscreen: ($mdMedia('xs')), }); }; diff --git a/src/app/components/login/save.less b/src/app/components/login/save.less index 20bfde890..1febe73d9 100644 --- a/src/app/components/login/save.less +++ b/src/app/components/login/save.less @@ -1,13 +1,4 @@ - .dialog-save { - .passphrase { - font-size: 150%; - margin-bottom: 30px; - border: 0; - width: 1000px; - max-width: 100%; - } - .missing { padding: 0 5px 0; font-weight: bold; @@ -15,10 +6,3 @@ } } -@media (max-width: 550px) { - .dialog-save { - .passphrase { - height: 6em; - } - } -} diff --git a/src/app/components/login/save.pug b/src/app/components/login/save.pug index 236ba4350..bd31386d8 100644 --- a/src/app/components/login/save.pug +++ b/src/app/components/login/save.pug @@ -1,4 +1,4 @@ -md-dialog.dialog-save(aria-label='Save your passphrase in a safe place!') +md-dialog.dialog-save(flex='80', aria-label='Save your passphrase in a safe place!') form md-toolbar .md-toolbar-tools @@ -7,8 +7,8 @@ md-dialog.dialog-save(aria-label='Save your passphrase in a safe place!') span(ng-if="$ctrl.enter") Enter the missing word to continue md-dialog-content .md-dialog-content - div(ng-if="!$ctrl.enter") - textarea.passphrase(ng-bind='$ctrl.passphrase', md-autofocus) + md-input-container.md-block(ng-if="!$ctrl.enter") + textarea.passphrase(ng-bind='$ctrl.passphrase', md-autofocus, readonly) div(ng-if="$ctrl.enter") p.passphrase span {{ $ctrl.pre }} From 99f81e08f53c23cd190a09d2150eeac09f0fb8ac Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Tue, 2 May 2017 17:53:02 +0200 Subject: [PATCH 3/3] Fix account balance update logic --- src/app/components/main/main.js | 2 +- src/test/components/main/main.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/main/main.js b/src/app/components/main/main.js index 79e29b67b..573d64126 100644 --- a/src/app/components/main/main.js +++ b/src/app/components/main/main.js @@ -71,7 +71,7 @@ app.component('main', { this.account.set({ balance: res.balance }); }) .catch((res) => { - this.account.get({ balance: null }); + this.account.set({ balance: null }); return this.$q.reject(res); }) .finally(() => { diff --git a/src/test/components/main/main.spec.js b/src/test/components/main/main.spec.js index 653afe58f..f893f6afa 100644 --- a/src/test/components/main/main.spec.js +++ b/src/test/components/main/main.spec.js @@ -180,7 +180,7 @@ describe('main component controller', () => { controller.update(); deffered.reject(); $scope.$apply(); - expect(account.get().balance).to.equal(undefined); + expect(account.get().balance).to.equal(null); $rootScope.reset(); expect(spy).to.have.been.calledWith(); });