Fix Conflicts:

views/unsupported.html
This commit is contained in:
Gustavo Maximiliano Cortez 2014-08-06 18:51:04 -03:00
commit 0c2141c380
53 changed files with 1983 additions and 1297 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('CopayersController',
function($scope, $rootScope, $location, backupService) {
function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils) {
$scope.backup = function() {
var w = $rootScope.wallet;
@ -18,4 +18,12 @@ angular.module('copayApp.controllers').controller('CopayersController',
$location.path('/addresses');
};
$scope.deleteWallet = function() {
var w = $rootScope.wallet;
w.disconnect();
walletFactory.delete(w.id, function() {
controllerUtils.logout();
});
};
});

View file

@ -9,5 +9,5 @@ angular.module('copayApp.controllers').controller('HomeController',
if ($rootScope.pendingPayment) {
notification.info('Login Required', 'Please open wallet to complete payment');
}
$scope.hasWallets = walletFactory.getWallets().length > 0 ? true : false;
$scope.hasWallets = (walletFactory.getWallets() && walletFactory.getWallets().length > 0) ? true : false;
});

View file

@ -11,7 +11,7 @@ angular.module('copayApp.controllers').controller('OpenController',
};
$scope.loading = false;
$scope.wallets = walletFactory.getWallets().sort(cmp);
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
$scope.selectedWalletId = walletFactory.storage.getLastOpened() || ($scope.wallets[0] && $scope.wallets[0].id);
$scope.openPassword = '';
$scope.open = function(form) {

View file

@ -50,7 +50,7 @@ angular.module('copayApp.controllers').controller('SendController',
var w = $rootScope.wallet;
w.createTx(address, amount, commentText, function(ntxid) {
if (w.totalCopayers > 1) {
if (w.isShared()) {
$scope.loading = false;
var message = 'The transaction proposal has been created';
notification.success('Success!', message);

View file

@ -76,6 +76,8 @@ angular.module('copayApp.controllers').controller('SettingsController',
unitToSatoshi: $scope.selectedUnit.value,
}));
window.location.reload();
// Go home reloading the application
var hashIndex = window.location.href.indexOf('#!/');
window.location = window.location.href.substr(0, hashIndex);
};
});

View file

@ -3,8 +3,6 @@
angular.module('copayApp.controllers').controller('SidebarController',
function($scope, $rootScope, $sce, $location, $http, notification, controllerUtils) {
$scope.version = copay.version;
$scope.networkName = config.networkName;
$scope.menu = [{
'title': 'Addresses',
'icon': 'fi-address-book',
@ -62,23 +60,6 @@ angular.module('copayApp.controllers').controller('SidebarController',
return new Array(num);
}
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) {
var toInt = function(s) {
return parseInt(s);
};
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
var currentVersion = copay.version.split('.').map(toInt);
var title = 'Copay ' + data[0].name + ' available.';
var content;
if (currentVersion[0] < latestVersion[0]) {
content = 'It\'s important that you update your wallet at https://copay.io';
notification.version(title, content, true);
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
var content = 'Please update your wallet at https://copay.io';
notification.version(title, content, false);
}
});
// Init socket handlers (with no wallet yet)
controllerUtils.setSocketHandlers();

26
js/controllers/version.js Normal file
View file

@ -0,0 +1,26 @@
'use strict';
angular.module('copayApp.controllers').controller('VersionController',
function($scope, $rootScope, $http, notification) {
$scope.version = copay.version;
$scope.networkName = config.networkName;
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) {
var toInt = function(s) {
return parseInt(s);
};
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
var currentVersion = copay.version.split('.').map(toInt);
var title = 'Copay ' + data[0].name + ' available.';
var content;
if (currentVersion[0] < latestVersion[0]) {
content = 'It\'s important that you update your wallet at https://copay.io';
notification.version(title, content, true);
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
var content = 'Please update your wallet at https://copay.io';
notification.version(title, content, false);
}
});
});