mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Mark private messages as read when entering the inbox and syncing while in the inbox. closes #7689
This commit is contained in:
@@ -22,8 +22,8 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||||||
$rootScope.pageTitle = $state.current.title;
|
$rootScope.pageTitle = $state.current.title;
|
||||||
|
|
||||||
if (!!fromState.name) Analytics.track({'hitType':'pageview','eventCategory':'navigation','eventAction':'navigate','page':'/#/'+toState.name});
|
if (!!fromState.name) Analytics.track({'hitType':'pageview','eventCategory':'navigation','eventAction':'navigate','page':'/#/'+toState.name});
|
||||||
// clear inbox when entering or exiting inbox tab
|
// clear inbox when entering inbox tab
|
||||||
if (fromState.name=='options.social.inbox' || toState.name=='options.social.inbox') {
|
if (toState.name=='options.social.inbox') {
|
||||||
User.clearNewMessages();
|
User.clearNewMessages();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ angular.module('habitrpg')
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
var tasks = response.data.data;
|
var tasks = response.data.data;
|
||||||
syncUserTasks(tasks);
|
syncUserTasks(tasks);
|
||||||
|
if ($rootScope.$state && $rootScope.$state.current.name=='options.social.inbox') {
|
||||||
|
userServices.clearNewMessages();
|
||||||
|
}
|
||||||
$rootScope.$emit('userSynced');
|
$rootScope.$emit('userSynced');
|
||||||
$rootScope.appLoaded = true;
|
$rootScope.appLoaded = true;
|
||||||
$rootScope.$emit('userUpdated', user);
|
$rootScope.$emit('userUpdated', user);
|
||||||
|
|||||||
Reference in New Issue
Block a user