Merge pull request #2118 from matiu/pin

Pin
This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-12 11:50:43 -03:00
commit 376a36b68d
11 changed files with 52 additions and 30 deletions

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
sign:
gpg -u 1112CFA1 --output browser-extensions/chrome/copay-chrome-extension.zip.sig --detach-sig browser-extensions/chrome/copay-chrome-extension.zip
verify:
gpg --verify browser-extensions/chrome/copay-chrome-extension.zip.sig browser-extensions/chrome/copay-chrome-extension.zip
ios:
cordova/build.sh
cd cordova/project && cordova build ios
open cordova/project/platforms/ios/Copay.xcodeproj
ios-debug:
cordova/build.sh --dbgjs
cd cordova/project && cordova build ios
open cordova/project/platforms/ios/Copay.xcodeproj
android:
cordova/build.sh --android
cd cordova/project && cordova run android
chrome:
browser-extensions/chrome/build.sh

View File

@ -73,24 +73,23 @@ var defaultConfig = {
salt: 'jBbYTj8zTrOt6V',
},
/*
GoogleDrive: {
home: 'copay',
/*
* This clientId was generated at:
* https://console.developers.google.com/project
* To run Copay with Google Drive at your domain you need
* to generata your own Id.
*/
// This clientId was generated at:
// https://console.developers.google.com/project
// To run Copay with Google Drive at your domain you need
// to generata your own Id.
// for localhost:3001 you can use you can:
//
clientId: '232630733383-a35gcnovnkgka94394i88gq60vtjb4af.apps.googleusercontent.com',
// for copay.io:
// clientId: '1036948132229-biqm3b8sirik9lt5rtvjo9kjjpotn4ac.apps.googleusercontent.com',
},
developmentFeatures: false
*/
};
if (typeof module !== 'undefined')
module.exports = defaultConfig;

View File

@ -8,6 +8,7 @@ var ls = new LS();
// TODO move this to configService !
var config = copay.defaultConfig;
ls.getItem('config', function(err, data) {
var localConfig;
try {

View File

@ -160,6 +160,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.error = 'Please enter the required fields';
return;
}
$scope.saveSettings(function(err) {
preconditions.checkState(!err, err);

View File

@ -133,8 +133,9 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.error = 'Invalid email or password. You are trying to sign in using ' + storage + '. Change it on settings is necessary.';
};
pinService.clear(function() {
});
$rootScope.hasPin = false;
pinService.clear(function() {});
} else if ((err.toString() || '').match('Connection')) {
$scope.error = 'Could not connect to Insight Server';
} else if ((err.toString() || '').match('Unable')) {

View File

@ -77,7 +77,6 @@ angular.module('copayApp.controllers').controller('SettingsController', function
configService.set({
network: insightSettings,
version: copay.version,
defaultLanguage: $scope.selectedLanguage.isoCode,
plugins: plugins,
logLevel: $scope.selectedLogLevel.name,

View File

@ -498,6 +498,7 @@ PublicKeyRing.prototype.getCosigner = function(pubKey) {
PublicKeyRing.prototype.buildAddressCache = function() {
var ret = [];
var self = this;
_.each(this.indexes, function(index) {
for (var i = 0; i < index.receiveIndex; i++) {
self._getAddress(i, false, index.copayerIndex);

View File

@ -350,6 +350,7 @@ Wallet.prototype._onPublicKeyRing = function(senderId, data) {
}
if (this.publicKeyRing.isComplete()) {
this._lockIncomming();
this.subscribeToAddresses();
this.emitAndKeepAlive('ready');
} else {
this.emitAndKeepAlive('publicKeyRingUpdated');
@ -739,7 +740,7 @@ Wallet.prototype._onData = function(senderId, data, ts) {
this._onSignature(senderId, data);
break;
case 'indexes':
this._onIndexes(data.indexes);
this._onIndexes(senderId, data);
break;
case 'addressbook':
this._onAddressBook(senderId, data);

View File

@ -1,20 +1,22 @@
'use strict';
angular.module('copayApp.services').factory('configService', function(localstorageService, gettextCatalog) {
angular.module('copayApp.services').factory('configService', function($timeout, localstorageService, gettextCatalog) {
var root = {};
root.set = function(opts, cb) {
// Options that have runtime effects
if (opts.logLevel)
copay.logger.setLevel(opts.logLevel);
if (opts.defaultLanguage)
gettextCatalog.currentLanguage = opts.defaultLanguage;
// Set current version
opts.version = copay.version;
localstorageService.getItem('config', function(err, oldOpsStr) {
var oldOpts = {};
try {
oldOpts = JSON.parse(oldOpsStr);
} catch (e) {};
@ -22,9 +24,8 @@ angular.module('copayApp.services').factory('configService', function(localstora
var newOpts = {};
_.extend(newOpts, copay.defaultConfig, oldOpts, opts);
// TODO remove this gloval variable.
// TODO remove this global variable.
config = newOpts;
localstorageService.setItem('config', JSON.stringify(newOpts), cb);
});
};

View File

@ -140,7 +140,7 @@ angular.module('copayApp.services')
};
root.notifyTxProposalEvent = function(w, e) {
if (e.cId == w.getMyCopayerId())
if (e.cId == w.getMyCopayerId())
return;
var user = w.publicKeyRing.nicknameForCopayer(e.cId);
@ -184,7 +184,8 @@ angular.module('copayApp.services')
w.on('ready', function() {
var isFocused = root.isFocused(wid);
copay.logger.debug('Wallet:' + w.getName() + ' is ready. Focused:', isFocused);
copay.logger.debug('Wallet:' + w.getName() +
' is ready. Focused:', isFocused);
balanceService.update(w, function() {
$rootScope.$digest();
@ -227,7 +228,7 @@ angular.module('copayApp.services')
// w.on('paymentACK', function(memo) {
// notification.success('Payment Acknowledged', memo);
// });
w.on('txProposalEvent', function(ev) {
if (root.isFocused(wid)) {
@ -241,7 +242,7 @@ angular.module('copayApp.services')
}, root.isFocused(wid));
root.notifyTxProposalEvent(w, ev);
$timeout(function(){
$timeout(function() {
$rootScope.$digest();
});
});
@ -269,7 +270,8 @@ angular.module('copayApp.services')
root.setupGlobalVariables(iden);
iden.on('newWallet', function(wid) {
var w = iden.getWalletById(wid);
copay.logger.debug('newWallet:', w.getName(), wid, iden.getLastFocusedWalletId());
copay.logger.debug('newWallet:',
w.getName(), wid, iden.getLastFocusedWalletId());
root.installWalletHandlers(w);
if (wid == iden.getLastFocusedWalletId()) {
copay.logger.debug('GOT Focused wallet:', w.getName());

View File

@ -36,14 +36,8 @@
"test": "sh test/run.sh",
"dist": "node shell/scripts/dist.js",
"shell": "node shell/scripts/launch.js",
"chrome": "source browser-extensions/chrome/build.sh",
"setup-shell": "node shell/scripts/download-atom-shell.js",
"postinstall": "./node_modules/.bin/grunt",
"sign": "gpg -u 1112CFA1 --output browser-extensions/chrome/copay-chrome-extension.zip.sig --detach-sig browser-extensions/chrome/copay-chrome-extension.zip",
"verify": "gpg --verify browser-extensions/chrome/copay-chrome-extension.zip.sig browser-extensions/chrome/copay-chrome-extension.zip",
"ios": "cordova/build.sh && cd cordova/project && cordova build ios && open platforms/ios/Copay.xcodeproj",
"android": "cordova/build.sh --android && cd cordova/project && cordova run android"
"postinstall": "./node_modules/.bin/grunt"
},
"devDependencies": {
"angular-gravatar": "*",