mirror of https://github.com/BTCPrivate/copay.git
working!
This commit is contained in:
parent
fe37bcc9e9
commit
9ad326cd30
|
@ -53,12 +53,14 @@ var defaultConfig = {
|
|||
verbose: 1,
|
||||
|
||||
plugins: {
|
||||
// LocalStorage: true,
|
||||
GoogleDrive: true,
|
||||
LocalStorage: true,
|
||||
// GoogleDrive: true,
|
||||
},
|
||||
|
||||
GoogleDrive: {
|
||||
clientId: '232630733383-29u1khqf5i8qubhf0homhpb2m14b5lja.apps.googleusercontent.com',
|
||||
// for localhost:
|
||||
clientId: '232630733383-a35gcnovnkgka94394i88gq60vtjb4af.apps.googleusercontent.com',
|
||||
// clientId: '232630733383-29u1khqf5i8qubhf0homhpb2m14b5lja.apps.googleusercontent.com',
|
||||
home: 'copay'
|
||||
},
|
||||
};
|
||||
|
|
|
@ -4,10 +4,10 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
|||
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
$scope.loading = true;
|
||||
$scope.retreiving = true;
|
||||
|
||||
walletFactory.getWallets(function(ret) {
|
||||
$scope.loading = false;
|
||||
$scope.retreiving = false;
|
||||
$scope.hasWallets = (ret && ret.length > 0) ? true : false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,6 +14,7 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
|
|||
};
|
||||
$rootScope.fromSetup = false;
|
||||
$scope.loading = false;
|
||||
$scope.retreiving = true;
|
||||
walletFactory.getWallets(function(wallets) {
|
||||
$scope.wallets = wallets.sort(cmp);
|
||||
|
||||
|
@ -23,6 +24,7 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
|
|||
|
||||
walletFactory.storage.getLastOpened(function(ret) {
|
||||
$scope.selectedWalletId = ret || ($scope.wallets[0] && $scope.wallets[0].id);
|
||||
$scope.retreiving = false;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ Storage.prototype.getGlobal = function(k, cb) {
|
|||
preconditions.checkArgument(cb);
|
||||
|
||||
this.storage.getItem(k, function(item) {
|
||||
console.log('[Storage.js.96:item:]',item); //TODO
|
||||
cb(item == 'undefined' ? undefined : item);
|
||||
});
|
||||
};
|
||||
|
@ -121,9 +120,7 @@ Storage.prototype.get = function(walletId, k, cb) {
|
|||
|
||||
|
||||
Storage.prototype._readHelper = function(walletId, k, cb) {
|
||||
console.log('[Storage.js.134:walletId:]',walletId,k); //TODO
|
||||
var wk = this._key(walletId, k);
|
||||
|
||||
this._read(wk, function(v){
|
||||
return cb(v,k);
|
||||
});
|
||||
|
@ -141,10 +138,7 @@ console.log('[Storage.js.142:keys:]',keys); //TODO
|
|||
for (var ii in keys) {
|
||||
this._readHelper(walletId, keys[ii], function(v, k) {
|
||||
ret[k] = v;
|
||||
console.log('[Storage.js.144:ret:]',k,i,l,v); //TODO
|
||||
if (++i == l) {
|
||||
|
||||
console.log('[Storage.js.157] LKIST', ret); //TODO
|
||||
return cb(ret);
|
||||
}
|
||||
});
|
||||
|
@ -174,11 +168,9 @@ Storage.prototype.getWalletIds = function(cb) {
|
|||
var uniq = {};
|
||||
|
||||
this.storage.allKeys(function(keys) {
|
||||
console.log('[Storage.js.170:keys:]',keys); //TODO
|
||||
|
||||
for (var ii in keys) {
|
||||
var key = keys[ii];
|
||||
console.log('[Storage.js.174:key:]',key); //TODO
|
||||
var split = key.split('::');
|
||||
if (split.length == 2) {
|
||||
var walletId = split[0];
|
||||
|
@ -201,20 +193,17 @@ Storage.prototype.getWallets = function(cb) {
|
|||
var self = this;
|
||||
|
||||
this.getWalletIds(function(ids) {
|
||||
console.log('[Storage.js.197:ids:]',ids); //TODO
|
||||
var l = ids.length, i=0;
|
||||
if (!l)
|
||||
return cb([]);
|
||||
|
||||
for (var ii in ids) {
|
||||
var id = ids[ii];
|
||||
console.log('[Storage.js.206:id:]',id); //TODO
|
||||
self.getName(id, function(name) {
|
||||
wallets.push({
|
||||
id: id,
|
||||
name: name,
|
||||
});
|
||||
console.log('[Storage.js.208:wallets:]',wallets); //TODO
|
||||
if (++i == l) {
|
||||
return cb(wallets);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.services').factory('walletFactory', function(pluginManager){
|
||||
|
||||
console.log('[walletFactory.js.3]'); //TODO
|
||||
return new copay.WalletFactory(config, copay.version, pluginManager);
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ function LocalStorage() {
|
|||
};
|
||||
|
||||
LocalStorage.prototype.init = function() {
|
||||
console.log(' init LocalStorage'); //TODO
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<div class="home" ng-controller="HomeController">
|
||||
<div class="row">
|
||||
<div data-alert class="loading-screen" ng-show="retreiving">
|
||||
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
|
||||
Retreiving information from storage...
|
||||
</div>
|
||||
<div class="row" ng-show="!loading">
|
||||
<div class="large-4 columns logo-setup">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
<div class="open" ng-controller="OpenController">
|
||||
<div data-alert class="loading-screen" ng-show="loading && !failure">
|
||||
<div data-alert class="loading-screen" ng-show="retreiving">
|
||||
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
|
||||
Retreiving information from storage...
|
||||
</div>
|
||||
<div data-alert class="loading-screen" ng-show="loading && !failure && !retreiving">
|
||||
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
|
||||
<span translate>Connecting...</span>
|
||||
</div>
|
||||
<div class="row" ng-show="!loading">
|
||||
<div class="row" ng-show="!loading && !retreiving">
|
||||
<div class="large-4 columns logo-setup">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
|
|
Loading…
Reference in New Issue