mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
allow notification icon to go grey by deleting seen message data instead of setting to false
This commit is contained in:
@@ -47,7 +47,7 @@ angular.module('groupServices', ['ngResource']).
|
|||||||
// On enter, set chat message to "seen"
|
// On enter, set chat message to "seen"
|
||||||
seenMessage: function(gid){
|
seenMessage: function(gid){
|
||||||
$http.post('/api/v2/groups/'+gid+'/chat/seen');
|
$http.post('/api/v2/groups/'+gid+'/chat/seen');
|
||||||
if (User.user.newMessages) User.user.newMessages[gid] = false;
|
if (User.user.newMessages) delete User.user.newMessages[gid];
|
||||||
},
|
},
|
||||||
|
|
||||||
// Pass reference to party, myGuilds, publicGuilds, tavern; inside data in order to
|
// Pass reference to party, myGuilds, publicGuilds, tavern; inside data in order to
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ api.seenMessage = function(req,res,next){
|
|||||||
// Skip the auth step, we want this to be fast. If !found with uuid/token, then it just doesn't save
|
// Skip the auth step, we want this to be fast. If !found with uuid/token, then it just doesn't save
|
||||||
// Check for req.params.gid to exist
|
// Check for req.params.gid to exist
|
||||||
if(req.params.gid){
|
if(req.params.gid){
|
||||||
var update = {$set:{}};
|
var update = {$unset:{}};
|
||||||
update['$set']['newMessages.'+req.params.gid+'.value'] = false;
|
update['$unset']['newMessages.'+req.params.gid] = '';
|
||||||
User.update({_id:req.headers['x-api-user'], apiToken:req.headers['x-api-key']},update).exec();
|
User.update({_id:req.headers['x-api-user'], apiToken:req.headers['x-api-key']},update).exec();
|
||||||
}
|
}
|
||||||
res.send(200);
|
res.send(200);
|
||||||
|
|||||||
Reference in New Issue
Block a user