mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Added force cache update when fetching new messages (#7360)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
f0f67e1e88
commit
9a32a01a3e
@@ -114,12 +114,19 @@ habitrpg.controller('ChatCtrl', ['$scope', 'Groups', 'Chat', 'User', '$http', 'A
|
||||
});
|
||||
};
|
||||
|
||||
function handleGroupResponse (response) {
|
||||
$scope.group = response;
|
||||
if (!$scope.group._id) $scope.group = response.data.data;
|
||||
};
|
||||
|
||||
$scope.sync = function(group) {
|
||||
//@TODO: We need to use chat service here
|
||||
Groups.Group.get(group._id)
|
||||
.then(function (response) {
|
||||
$scope.group = response.data.data;
|
||||
})
|
||||
if (group.name === Groups.TAVERN_NAME) {
|
||||
Groups.tavern(true).then(handleGroupResponse);
|
||||
} else if (group._id === User.user.party._id) {
|
||||
Groups.party(true).then(handleGroupResponse);
|
||||
} else {
|
||||
Groups.Group.get(group._id).then(handleGroupResponse);
|
||||
}
|
||||
|
||||
Chat.markChatSeen(group._id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user