add missing username for blog notifications (#5422)

The notifications backend it worked fine, but the frontend was missing the username variable to be in able to display the 'New' badge correctly
This commit is contained in:
gabryon99 2021-05-31 10:25:40 +02:00
parent 7d51eb47f7
commit 24f054f009
6 changed files with 39 additions and 35 deletions

View file

@ -71,12 +71,14 @@ function blog_utils.updatePostState(blogNotificationId, username)
for _, p in pairs(posts) do
if (p.id == blogNotificationId) then
if (p.users_read == nil) then p.users_read = {} end
p.users_read[username] = true
success = true
if (p.users_read == nil) then p.users_read = {} end
p.users_read[username] = true
success = true
end
end
tprint(posts)
ntop.setPref(BLOG_FEED_KEY, json.encode(posts))
return (success)