Wallet/src/js/controllers/onboarding/notifications.js

32 lines
794 B
JavaScript
Raw Normal View History

2016-08-25 16:31:47 -03:00
'use strict';
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, profileService, configService) {
$scope.$on("$ionicView.enter", function(event, data) {
$scope.walletId = data.stateParams.walletId;
});
2016-08-25 16:31:47 -03:00
$scope.allowNotif = function() {
$timeout(function() {
profileService.pushNotificationsInit();
});
$state.go('onboarding.backupRequest', {
walletId: $scope.walletId
});
2016-08-25 16:31:47 -03:00
}
$scope.disableNotif = function() {
var opts = {
pushNotifications: {
enabled: false
}
};
configService.set(opts, function(err) {
if (err) $log.warn(err);
$state.go('onboarding.backupRequest', {
walletId: $scope.walletId
});
});
};
2016-08-25 16:31:47 -03:00
});