This commit is contained in:
Matias Alejo Garcia 2016-08-19 13:07:18 -03:00
parent aa372ea618
commit a8cf875def
No known key found for this signature in database
GPG Key ID: 02470DB551277AB3
22 changed files with 53 additions and 1392 deletions

View File

@ -163,7 +163,7 @@
<button
class="button round expand"
href ui-sref="walletHome"
href ui-sref="tabs.home"
translate>Finish
</button>
<!-- hide this in multisig just to show less text -->

View File

@ -104,10 +104,10 @@
<div translate>
Only Main (not change) addresses are shown. The addresses on this list were not verified locally at this time.
</div>
<button class="button button-block" ng-style="{'color':wallet.color}" href ui-sref="walletHome" ng-click="index.retryScan()" translate>
<button class="button button-block button-positive" href ui-sref="walletHome" ng-click="scan()" translate>
Scan addresses for funds
</button>
<button class="button button-block" ng-style="{'color':wallet.color}" ng-show="isCordova" ng-click="sendAddrs()" translate>
<button class="button button-block button-positive" ng-show="isCordova" ng-click="sendAddrs()" translate>
Send addresses by email
</button>

View File

@ -4,27 +4,25 @@ angular.module('copayApp.controllers').controller('backupController',
function($rootScope, $scope, $timeout, $log, $state, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
var fc = profileService.focusedClient;
var prevState;
$scope.customWords = [];
$scope.walletName = fc.credentials.walletName;
$scope.credentialsEncrypted = fc.isPrivKeyEncrypted;
$scope.init = function(state) {
prevState = state || 'walletHome';
$scope.init = function() {
$scope.step = 1;
$scope.deleted = isDeletedSeed();
if ($scope.deleted) return;
fingerprintService.check(fc, function(err) {
if (err) {
go.path(prevState);
$state.go('tabs.home')
return;
}
handleEncryptedWallet(fc, function(err) {
if (err) {
$log.warn('Error decrypting credentials:', $scope.error);
go.path(prevState);
$state.go('tabs.home')
return;
}
$scope.credentialsEncrypted = false;

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('copayersController',
function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, go, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) {
function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, $state, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) {
var self = this;
$scope.isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
@ -39,7 +39,7 @@ angular.module('copayApp.controllers').controller('copayersController',
$scope.$digest();
});
} else {
go.walletHome();
$state.go('tabs.home');
$timeout(function() {
notification.success(
gettextCatalog.getString('Success'),

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $timeout, $log, lodash, go, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService) {
function($scope, $rootScope, $timeout, $log, lodash, $state, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService) {
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
@ -187,8 +187,7 @@ angular.module('copayApp.controllers').controller('createController',
$rootScope.$emit('Local/BackupDone');
}, 1);
}
go.walletHome();
$state.go('tabs.home')
});
}, 100);
}

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('disclaimerController',
function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService, gettext, platformInfo, ongoingProcess) {
function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, $state, storageService, gettext, platformInfo, ongoingProcess) {
var tries = 0;
var isCordova = platformInfo.isCordova;
@ -49,7 +49,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
if (!err || !err.message || !err.message.match('NONAGREEDDISCLAIMER')) {
$log.debug('Disclaimer already accepted at #disclaimer. Redirect to Wallet Home.');
$ionicSideMenuDelegate.canDragContent(true);
go.walletHome();
$state.go('tabs.home');
}
});
}
@ -62,7 +62,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
else {
$ionicSideMenuDelegate.canDragContent(true);
$rootScope.$emit('disclaimerAccepted');
go.walletHome();
$state.go('tabs.home');
}
});
};

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('exportController',
function($rootScope, $scope, $timeout, $log, lodash, backupService, walletService, storageService, profileService, platformInfo, notification, go, gettext, gettextCatalog, $state, $stateParams) {
function($rootScope, $scope, $timeout, $log, lodash, backupService, walletService, storageService, profileService, platformInfo, notification, gettext, gettextCatalog, $state, $stateParams) {
var prevState;
var isWP = platformInfo.isWP;
var isAndroid = platformInfo.isAndroid;
@ -69,7 +69,7 @@ angular.module('copayApp.controllers').controller('exportController',
return;
}
notification.success(gettext('Success'), gettext('Encrypted export file saved'));
go.walletHome();
$state.go('tabs.home');
});
});
};

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('importController',
function($scope, $rootScope, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) {
function($scope, $rootScope, $timeout, $log, profileService, configService, notification, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
@ -111,7 +111,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};
@ -139,7 +139,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};
@ -160,7 +160,7 @@ angular.module('copayApp.controllers').controller('importController',
}
$rootScope.$emit('Local/WalletImported', walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};
@ -190,7 +190,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};
@ -325,7 +325,7 @@ angular.module('copayApp.controllers').controller('importController',
});
$rootScope.$emit('Local/WalletImported', wallet.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};
@ -403,7 +403,7 @@ angular.module('copayApp.controllers').controller('importController',
});
$rootScope.$emit('Local/WalletImported', wallet.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, go, notification, profileService, configService, storageService, applicationService, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log) {
function($scope, $rootScope, $timeout, $state, notification, profileService, configService, storageService, applicationService, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
@ -140,7 +140,7 @@ angular.module('copayApp.controllers').controller('joinController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
});
go.walletHome();
$state.go('tabs.home');
});
}, 100);
};

View File

@ -1,5 +1,5 @@
angular.module('copayApp.controllers').controller('paperWalletController',
function($scope, $timeout, $log, $ionicModal, configService, profileService, go, addressService, txStatus, bitcore, ongoingProcess, txFormatService) {
function($scope, $timeout, $log, $ionicModal, configService, profileService, $state, addressService, txStatus, bitcore, ongoingProcess, txFormatService) {
var fc = profileService.focusedClient;
var rawTx;
@ -102,7 +102,7 @@ angular.module('copayApp.controllers').controller('paperWalletController',
} else {
var type = txStatus.notify(txp);
$scope.openStatusModal(type, txp, function() {
go.walletHome();
$state.go('tabs.home');
});
}
$scope.$apply();

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('paymentUriController',
function($rootScope, $scope, $stateParams, $location, $timeout, profileService, configService, lodash, bitcore, go) {
function($rootScope, $scope, $stateParams, $location, $timeout, profileService, configService, lodash, bitcore, $state) {
function strip(number) {
return (parseFloat(number.toPrecision(12)));
};
@ -47,7 +47,7 @@ angular.module('copayApp.controllers').controller('paymentUriController',
this.selectWallet = function(wid) {
var self = this;
profileService.setAndStoreFocus(wid, function() {});
go.walletHome();
$state.go('tabs.home');
$timeout(function() {
$rootScope.$emit('paymentUri', self.bitcoinURI);
}, 1000);

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, go, gettext, gettextCatalog, applicationService, ongoingProcess) {
function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, $state, gettext, gettextCatalog, applicationService, ongoingProcess) {
var isCordova = platformInfo.isCordova;
$scope.isCordova = isCordova;
$scope.error = null;
@ -38,7 +38,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
if (err) {
$scope.error = err.message || err;
} else {
go.walletHome();
$state.go('tabs.home');
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {
walletName: walletName
}));

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesHistory',
function($scope, $log, $timeout, storageService, go, profileService, lodash) {
function($scope, $log, $timeout, storageService, $state, profileService, lodash) {
var fc = profileService.focusedClient;
var c = fc.credentials;
$scope.csvReady = false;
@ -125,7 +125,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
$scope.$emit('Local/ClearHistory');
$timeout(function() {
go.walletHome();
$state.go('tabs.home');
}, 100);
});
};

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesInformation',
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, go, $stateParams) {
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
var base = 'xpub';
var wallet = profileService.getWallet($stateParams.walletId);
var walletId = wallet.id;
@ -104,7 +104,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
opts.colorFor[walletId] = color;
configService.set(opts, function(err) {
go.walletHome();
$state.go('tabs.home');
if (err) $log.warn(err);
$scope.$emit('Local/ColorUpdated');
});
@ -121,4 +121,11 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
}
};
$scope.scan = function() {
walletService.startScan(wallet);
$state.go('tabs.home');
};
});

View File

@ -578,7 +578,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
});
})
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, go, gettextCatalog) {
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {
if (platformInfo.isCordova) {
if (screen.width < 768) {
@ -664,11 +664,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
else
secondBackButtonPress = true;
$timeout(function() {
$rootScope.$emit('Local/SetTab', 'walletHome', true);
}, 100);
go.walletHome();
$state.go('tabs.home');
});
$ionicPlatform.on('menubutton', function() {

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, platformInfo, go) {
.factory('applicationService', function($rootScope, $timeout, platformInfo, $state) {
var root = {};
var isChromeApp = platformInfo.isChromeApp;
@ -19,7 +19,7 @@ angular.module('copayApp.services')
if (isChromeApp) {
chrome.runtime.reload();
} else if (isNW) {
go.walletHome();
$state.go('tabs.home');
$timeout(function() {
var win = require('nw.gui').Window.get();
win.reload(3);

View File

@ -1,10 +1,6 @@
'use strict';
// DO NOT INCLUDE STORAGE HERE \/ \/
angular.module('copayApp.services').factory('walletService', function($log, $timeout, lodash, trezor, ledger, storageService, configService, rateService, uxLanguage, $filter, gettextCatalog, bwcError, $ionicPopup, fingerprintService, ongoingProcess, gettext, $rootScope, txStatus, txFormatService, $ionicModal) {
// DO NOT INCLUDE STORAGE HERE ^^
//
//
angular.module('copayApp.services').factory('walletService', function($log, $timeout, lodash, trezor, ledger, storageService, configService, rateService, uxLanguage, $filter, gettextCatalog, bwcError, $ionicPopup, fingerprintService, ongoingProcess, gettext, $rootScope, txStatus, txFormatService, $ionicModal, $state) {
// `wallet` is a decorated version of client.
var root = {};
@ -104,7 +100,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
console.log('[walletService.js.93] TODO NOT AUTH'); //TODO
// TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
wallet.notAuthorized = true;
go.walletHome();
$state.go('tabs.home');
} else if (err instanceof errors.NOT_FOUND) {
root.showErrorPopup(gettext('Could not access Wallet Service: Not found'));
} else {
@ -665,6 +661,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
alertPopup.then(cb);
};
// walletHome
root.recreate = function(wallet, cb) {
ongoingProcess.set('recreating', true);
wallet.recreateWallet(function(err) {
@ -672,7 +669,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
ongoingProcess.set('recreating', false);
if (err) {
wallet.handleError(err);
handleError(err);
return;
}
@ -693,12 +690,10 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
includeCopayerBranches: true,
}, function(err) {
// TODO
// if (err && wallet.walletId == walletId) {
// wallet.updating = false;
// wallet.handleError(err);
// $rootScope.$apply();
// }
if (err && wallet.walletId == walletId) {
wallet.updating = false;
handleError(err);
}
});
};