From b6edc6c91351532b1fe1d1367ae159a4c2a5c289 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sat, 15 Apr 2017 13:00:00 +0200 Subject: [PATCH] avoid multiple messages --- angular_app/js/controllers.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index 6a2b5ab..8a50418 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -293,7 +293,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', return false; } if (data.error && data.message) { - toaster.pop({type: 'error', title: 'Error', body: data.message, timeout: 5000}); + toaster.pop({type: 'error', title: 'Error', body: data.message, timeout: 0, showCloseButton: true}); return; } if (!$scope.event.tickets) { @@ -545,7 +545,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', $log.debug('addTicket'); $log.debug(ret_ticket); $rootScope.$emit('event:ticket:new', ret_ticket, function() { - $rootScope.$emit('event:ticket:set-attr', ret_ticket, 'attended', true, null, false); + $rootScope.$emit('event:ticket:set-attr', ret_ticket, 'attended', true, null, true); }); if (cb) { cb(ticket); @@ -600,7 +600,9 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', toaster.pop({type: 'info', title: 'ticket successfully updated'}); }); } else { - $scope.addTicket($scope.ticket); + $scope.addTicket($scope.ticket, function() { + $scope.showAttendedMessage($scope.ticket, true); + }); } };