Skip to content

Commit 6bd3f2a

Browse files
authored
Merge pull request #4046 from QuantiModo/feature/beforeLeave
qm.notifications.post() in RemindersInboxCtrl beforeLeave
2 parents 409c5f1 + 8e12822 commit 6bd3f2a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/js/controllers/remindersInboxCtrl.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
7575
}
7676
autoRefresh();
7777
});
78+
$scope.$on('$ionicView.beforeLeave', function(){
79+
qmLog.debug('RemindersInboxCtrl beforeLeave');
80+
qm.notifications.post();
81+
});
82+
$scope.$on('$ionicView.afterLeave', function(){
83+
qmLog.debug('RemindersInboxCtrl afterLeave');
84+
$rootScope.hideHomeButton = false;
85+
$rootScope.hideBackButton = false;
86+
});
7887
function readHelpCards(helpCard){
7988
if(!qm.speech.getSpeechEnabled()){
8089
return;
@@ -101,11 +110,7 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
101110
}
102111
}, 30 * 60 * 1000);
103112
}
104-
$scope.$on('$ionicView.afterLeave', function(){
105-
qmLog.debug('RemindersInboxCtrl afterLeave', null);
106-
$rootScope.hideHomeButton = false;
107-
$rootScope.hideBackButton = false;
108-
});
113+
109114
var setPageTitle = function(){
110115
if(getVariableCategoryName() === 'Treatments'){
111116
$scope.state.title = 'Overdue Meds';

0 commit comments

Comments
 (0)