fix merge conflicts

This commit is contained in:
Marty Alcala 2016-11-07 16:37:10 -05:00
commit d5476b6ccf
31 changed files with 275 additions and 171 deletions

View file

@ -239,10 +239,10 @@ angular.module('copayApp.controllers').controller('amountController', function($
});
} else {
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount;
$state.transitionTo('tabs.send.confirm', {
isWallet: $scope.isWallet,
toAmount: amount * unitToSatoshi,
toAmount: (amount * unitToSatoshi).toFixed(0),
toAddress: $scope.toAddress,
toName: $scope.toName,
toEmail: $scope.toEmail

View file

@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var cachedTxp = {};
var isChromeApp = platformInfo.isChromeApp;
var countDown = null;
$scope.isCordova = platformInfo.isCordova;
$ionicConfig.views.swipeBackEnabled(false);
$scope.$on("$ionicView.beforeEnter", function(event, data) {
@ -30,9 +31,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$log.error('Bad params at amount');
throw ('bad params');
}
$scope.isCordova = platformInfo.isCordova;
$scope.hasClick = platformInfo.hasClick;
$scope.data = {};
var config = configService.getSync().wallet;
$scope.feeLevel = config.settings && config.settings.feeLevel ? config.settings.feeLevel : 'normal';

View file

@ -1,32 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, gettextCatalog, profileService, walletService, configService) {
$scope.wallet = profileService.getWallet($stateParams.walletId);
var walletId = $scope.wallet.credentials.walletId;
var config = configService.getSync();
config.emailFor = config.emailFor || {};
$scope.emailForExist = config.emailFor && config.emailFor[walletId];
$scope.email = {
value: config.emailFor && config.emailFor[walletId]
};
$scope.save = function(val) {
var opts = {
emailFor: {}
};
opts.emailFor[walletId] = val;
walletService.updateRemotePreferences($scope.wallet, {
email: val,
}, function(err) {
if (err) $log.warn(err);
configService.set(opts, function(err) {
if (err) $log.warn(err);
$ionicHistory.goBack();
});
});
};
});

View file

@ -1,49 +1,97 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesNotificationsController',
function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) {
angular.module('copayApp.controllers').controller('preferencesNotificationsController', function($scope, $log, $timeout, $window, lodash, configService, platformInfo, pushNotificationsService, profileService, emailService) {
var updateConfig = function() {
var config = configService.getSync();
$scope.appName = $window.appConfig.nameCase;
$scope.PNEnabledByUser = true;
$scope.usePushNotifications = platformInfo.isCordova && !platformInfo.isWP;
$scope.isIOSApp = platformInfo.isIOS && platformInfo.isCordova;
var updateConfig = function() {
var config = configService.getSync();
var isCordova = platformInfo.isCordova;
var isIOS = platformInfo.isIOS;
$scope.appName = $window.appConfig.nameCase;
$scope.PNEnabledByUser = true;
$scope.isIOSApp = isIOS && isCordova;
if ($scope.isIOSApp) {
try {
PushNotification.hasPermission(function(data) {
$scope.PNEnabledByUser = data.isEnabled;
});
} catch(e) {
$log.error(e);
};
}
$scope.pushNotifications = {
value: config.pushNotifications.enabled
};
$scope.pushNotifications = {
value: config.pushNotifications.enabled
};
$scope.pushNotificationsChange = function() {
if (!$scope.pushNotifications) return;
var opts = {
pushNotifications: {
enabled: $scope.pushNotifications.value
}
};
configService.set(opts, function(err) {
if (opts.pushNotifications.enabled)
profileService.pushNotificationsInit();
else
pushNotificationsService.disableNotifications(profileService.getWallets());
if (err) $log.debug(err);
});
$scope.latestEmail = {
value: getLatestEmailConfig()
};
$scope.$on("$ionicView.enter", function(event, data) {
updateConfig();
$scope.newEmail = lodash.clone($scope.latestEmail);
var isEmailEnabled = config.emailNotifications ? config.emailNotifications.enabled : false;
$scope.emailNotifications = {
value: isEmailEnabled && $scope.newEmail.value ? true : false
};
$timeout(function() {
$scope.$apply();
});
};
$scope.pushNotificationsChange = function() {
if (!$scope.pushNotifications) return;
var opts = {
pushNotifications: {
enabled: $scope.pushNotifications.value
}
};
configService.set(opts, function(err) {
if (opts.pushNotifications.enabled)
profileService.pushNotificationsInit();
else
pushNotificationsService.disableNotifications(profileService.getWallets());
if (err) $log.debug(err);
});
};
$scope.emailNotificationsChange = function() {
var opts = {
emailNotifications: {
enabled: $scope.emailNotifications.value
}
};
configService.set(opts, function(err) {
if (err) $log.debug(err);
});
$scope.latestEmail = {
value: getLatestEmailConfig()
};
$scope.newEmail = lodash.clone($scope.latestEmail);
if (!$scope.emailNotifications.value) {
emailService.enableEmailNotifications({
enabled: $scope.emailNotifications.value,
email: null
});
}
$timeout(function() {
$scope.$apply();
});
};
$scope.save = function() {
emailService.enableEmailNotifications({
enabled: $scope.emailNotifications.value,
email: $scope.newEmail.value
});
$scope.latestEmail = {
value: $scope.newEmail.value
};
$timeout(function() {
$scope.$apply();
});
};
function getLatestEmailConfig() {
var config = configService.getSync();
return config.emailFor ? lodash.values(config.emailFor)[0] : null;
};
$scope.$on("$ionicView.enter", function(event, data) {
updateConfig();
});
});