add warning text on spending password prompt request

This commit is contained in:
Javier 2016-12-20 12:04:29 -03:00
commit b2bdb93f5b
3 changed files with 14 additions and 4 deletions

View file

@ -34,6 +34,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
$ionicPopup.prompt({ $ionicPopup.prompt({
title: title, title: title,
subTitle: message, subTitle: message,
cssClass: opts.class,
template: '<input ng-model="data.response" type="' + opts.inputType + '" autofocus>', template: '<input ng-model="data.response" type="' + opts.inputType + '" autofocus>',
inputPlaceholder: opts.inputPlaceholder, inputPlaceholder: opts.inputPlaceholder,
defaultText: opts.defaultText defaultText: opts.defaultText

View file

@ -827,7 +827,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
var askPassword = function(name, title, cb) { var askPassword = function(name, title, cb) {
var opts = { var opts = {
inputType: 'password', inputType: 'password',
forceHTMLPrompt: true forceHTMLPrompt: true,
class: 'text-warn'
}; };
popupService.showPrompt(title, name, opts, function(res) { popupService.showPrompt(title, name, opts, function(res) {
if (!res) return cb(); if (!res) return cb();
@ -838,10 +839,11 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
root.encrypt = function(wallet, cb) { root.encrypt = function(wallet, cb) {
var title = gettextCatalog.getString('Enter new spending password'); var title = gettextCatalog.getString('Enter new spending password');
askPassword(wallet.name, title, function(password) { var warnMsg = gettextCatalog.getString('Your wallet key will be encrypted. The Spending Password cannot be recovered. Be sure to write it down.');
askPassword(warnMsg, title, function(password) {
if (!password) return cb('no password'); if (!password) return cb('no password');
title = gettextCatalog.getString('Confirm you new spending password'); title = gettextCatalog.getString('Confirm you new spending password');
askPassword(wallet.name, gettextCatalog.getString('Confirm you new spending password'), function(password2) { askPassword(warnMsg, gettextCatalog.getString('Confirm you new spending password'), function(password2) {
if (!password2 || password != password2) if (!password2 || password != password2)
return cb('password mismatch'); return cb('password mismatch');
@ -854,7 +856,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
root.decrypt = function(wallet, cb) { root.decrypt = function(wallet, cb) {
$log.debug('Disabling private key encryption for' + wallet.name); $log.debug('Disabling private key encryption for' + wallet.name);
askPassword(wallet.name, gettextCatalog.getString('Enter Spending Password'), function(password) { askPassword(null, gettextCatalog.getString('Enter Spending Password'), function(password) {
if (!password) return cb('no password'); if (!password) return cb('no password');
try { try {

View file

@ -30,6 +30,13 @@
} }
} }
.text-warn {
.popup-sub-title {
margin-top: 15px;
color: #e42112 !important;
}
}
.item-toggle, .item { .item-toggle, .item {
white-space: normal; white-space: normal;
} }