Favicon > Add favicon with notification

This commit is contained in:
brunosimon
2017-09-07 14:11:22 +02:00
parent 833ff06835
commit 066a71e4d0
10 changed files with 115 additions and 22 deletions
+11 -1
View File
@@ -7,7 +7,8 @@ export default {
messages: [],
pendingMessage: null,
pendingAlert: null,
question: null
question: null,
unreadCount: 0
},
mutations:
@@ -16,6 +17,13 @@ export default {
{
state.messages.push(data)
// Add to unread count if not open or document is hidden (tab not active)
if(!state.open || document.hidden)
{
state.unreadCount++
}
// Clamp
if(state.messages.length > 100)
{
state.messages.splice(0, state.messages.length - 100)
@@ -50,6 +58,7 @@ export default {
openChat(state)
{
state.unreadCount = 0
state.open = true
},
@@ -60,6 +69,7 @@ export default {
toggleChat(state)
{
state.unreadCount = 0
state.open = !state.open
}
}