fix merge conflicts

This commit is contained in:
Marty Alcala 2016-10-11 19:14:13 -04:00
commit 6bfdec29b3
44 changed files with 28907 additions and 196 deletions

View file

@ -116,7 +116,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
};
popupService.showPrompt(null, message, opts, function(res) {
if (res) $scope.description = res;
if (typeof res != 'undefined') $scope.description = res;
$timeout(function() {
$scope.$apply();
}, 100);

View file

@ -1,7 +1,8 @@
'use strict';
angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, popupService, gettextCatalog) {
angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicConfig, popupService, gettextCatalog) {
$ionicConfig.views.swipeBackEnabled(false);
$scope.walletId = $stateParams.walletId;
$scope.openPopup = function() {
@ -18,7 +19,10 @@ angular.module('copayApp.controllers').controller('backupRequestController', fun
var cancelText = gettextCatalog.getString('Go back');
popupService.showConfirm(title, message, okText, cancelText, function(val) {
if (val) {
$state.go('onboarding.disclaimer', {walletId: $scope.walletId, backedUp: false});
$state.go('onboarding.disclaimer', {
walletId: $scope.walletId,
backedUp: false
});
}
});
}

View file

@ -2,6 +2,10 @@
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $timeout, $stateParams, $ionicModal) {
$scope.walletId = $stateParams.walletId;
$scope.fromState = $stateParams.from == 'onboarding' ? $stateParams.from + '.backupRequest' : $stateParams.from;
$scope.toState = $stateParams.from + '.backup';
$scope.openPopup = function() {
$ionicModal.fromTemplateUrl('views/includes/screenshotWarningModal.html', {
scope: $scope,
@ -15,24 +19,15 @@ angular.module('copayApp.controllers').controller('backupWarningController', fun
$scope.close = function() {
$scope.warningModal.hide();
$scope.warningModal.remove();
$timeout(function() {
if ($stateParams.from == 'onboarding.backupRequest') {
$state.go('onboarding.backup', {
walletId: $stateParams.walletId
});
} else {
$state.go($stateParams.from + '.backup', {
walletId: $stateParams.walletId
});
}
$state.go($scope.toState, {
walletId: $scope.walletId
});
};
}
$scope.goBack = function() {
$state.go($stateParams.from, {
walletId: $stateParams.walletId
$state.go($scope.fromState, {
walletId: $scope.walletId
});
};

View file

@ -1,7 +1,8 @@
'use strict';
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, profileService, configService, walletService, platformInfo) {
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, walletService, platformInfo) {
$ionicConfig.views.swipeBackEnabled(false);
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var usePushNotifications = isCordova && !isWP;

View file

@ -6,6 +6,7 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
$scope.terms = {};
$scope.accept1 = $scope.accept2 = $scope.accept3 = false;
$scope.backedUp = $stateParams.backedUp;
$scope.resume = $stateParams.resume;
$timeout(function() {
$scope.$apply();
}, 1);
@ -35,8 +36,10 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
});
};
$scope.goBack = function(){
$state.go('onboarding.backupRequest', {walletId: $stateParams.walletId});
$scope.goBack = function() {
$state.go('onboarding.backupRequest', {
walletId: $stateParams.walletId
});
}

View file

@ -1,10 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, profileService, configService) {
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService) {
$scope.$on("$ionicView.enter", function(event, data) {
$scope.walletId = data.stateParams.walletId;
});
$ionicConfig.views.swipeBackEnabled(false);
$scope.walletId = $stateParams.walletId;
$scope.allowNotif = function() {
$timeout(function() {

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tourController',
function($scope, $state, $log, $timeout, $filter, ongoingProcess, platformInfo, profileService, rateService) {
function($scope, $state, $log, $timeout, $filter, ongoingProcess, platformInfo, profileService, rateService, popupService, gettextCatalog) {
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
@ -37,6 +37,7 @@ angular.module('copayApp.controllers').controller('tourController',
});
});
var retryCount = 0;
$scope.createDefaultWallet = function() {
ongoingProcess.set('creatingWallet', true);
profileService.createDefaultWallet(function(err, walletClient) {
@ -44,9 +45,19 @@ angular.module('copayApp.controllers').controller('tourController',
$log.warn(err);
return $timeout(function() {
$log.warn('Retrying to create default wallet......');
return $scope.createDefaultWallet();
}, 3000);
$log.warn('Retrying to create default wallet.....:' + ++retryCount);
if (retryCount > 3) {
ongoingProcess.set('creatingWallet', false);
popupService.showAlert(
gettextCatalog.getString('Cannot Create Wallet'), err,
function() {
retryCount = 0;
return $scope.createDefaultWallet();
}, gettextCatalog.getString('Retry'));
} else {
return $scope.createDefaultWallet();
}
}, 2000);
};
ongoingProcess.set('creatingWallet', false);
var wallet = walletClient;
@ -55,8 +66,7 @@ angular.module('copayApp.controllers').controller('tourController',
$state.go('onboarding.backupRequest', {
walletId: walletId
});
}
else {
} else {
$state.go('onboarding.notifications', {
walletId: walletId
});

View file

@ -1,6 +1,8 @@
'use strict';
angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $log, profileService) {
angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService) {
$ionicConfig.views.swipeBackEnabled(false);
$scope.goImport = function(code) {
$state.go('onboarding.import', {

View file

@ -11,12 +11,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.version = $window.version;
$scope.name = $window.appConfig.nameCase;
$scope.homeTip = $stateParams.fromOnboarding;
$scope.isCordova = platformInfo.isCordova;
if(!$scope.homeTip){
storageService.getHomeTipAccepted(function(error, value){
$scope.homeTip = (value == 'false') ? false : true;
});
}
if (!$scope.homeTip) {
storageService.getHomeTipAccepted(function(error, value) {
$scope.homeTip = (value == 'false') ? false : true;
});
}
$scope.openNotificationModal = function(n) {
wallet = profileService.getWallet(n.walletId);
@ -170,8 +171,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
};
$scope.hideHomeTip = function() {
storageService.setHomeTipAccepted(false, function(error, value){
storageService.setHomeTipAccepted(false, function(error, value) {
$scope.homeTip = false;
$timeout(function() {
$scope.$apply();
})
});
};
@ -201,6 +205,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
});
};
$scope.onRefresh = function() {
$scope.$broadcast('scroll.refreshComplete');
updateAllWallets();
};
$scope.$on("$ionicView.enter", function(event, data) {
$scope.bitpayCard = null;
nextStep();

View file

@ -6,6 +6,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
var CONTACTS_SHOW_LIMIT;
var currentContactsPage;
var updateList = function() {
CONTACTS_SHOW_LIMIT = 10;
currentContactsPage = 0;
@ -103,11 +104,56 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
});
};
var updateHasFunds = function() {
$scope.hasFunds = null;
var wallets = profileService.getWallets({
onlyComplete: true,
});
if (!wallets || !wallets.length) {
$scope.hasFunds = false;
}
var index = 0;
lodash.each(wallets, function(w) {
walletService.getStatus(w, {}, function(err, status) {
++index;
if (err || !status) {
$log.error(err);
return;
}
if (status.availableBalanceSat) {
$scope.hasFunds = true;
}
if (index == wallets.length) {
$scope.hasFunds = $scope.hasFunds || false;
}
});
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.formData = {
search: null
};
updateList();
updateHasFunds();
});
// This could probably be enhanced refactoring the routes abstract states
$scope.createWallet = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.add.create-personal');
});
};
$scope.buyBitcoin = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.buyandsell.glidera');
});
};
});

View file

@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
$scope.txps = [];
$scope.completeTxHistory = [];
$scope.openTxpModal = txpModalService.open;
$scope.isCordova = platformInfo.isCordova;
$scope.openExternalLink = function(url, target) {
externalLinkService.open(url, target);
@ -159,6 +160,11 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
}, 100);
};
$scope.onRefresh = function() {
$scope.$broadcast('scroll.refreshComplete');
$scope.updateAll(true);
};
$scope.updateAll = function(force, cb)  {
updateStatus(force);
updateTxHistory(cb);