Wallet/src/js/controllers/onboarding/collectEmail.js

23 lines
736 B
JavaScript
Raw Normal View History

2016-08-25 16:31:47 -03:00
'use strict';
2016-08-29 11:56:31 -03:00
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $stateParams, profileService, walletService, platformInfo) {
$scope.skip = function() {
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
else $state.go('onboarding.notifications');
}
2016-08-25 16:31:47 -03:00
$scope.save = function(form) {
var wallet = profileService.getWallet($stateParams.walletId);
var email = $scope.email || '';
walletService.updateRemotePreferences(wallet, {
email: email,
}, function(err) {
if (err) $log.warn(err);
2016-08-29 11:56:31 -03:00
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
else $state.go('onboarding.notifications');
2016-08-25 16:31:47 -03:00
});
};
});