feat: show unread count

This commit is contained in:
Vlad Stan 2023-03-30 11:36:28 +03:00
parent 3a77bee659
commit 5942d135b3
2 changed files with 7 additions and 1 deletions

View file

@ -16,6 +16,7 @@ async function directMessages(path) {
data: function () {
return {
customers: [],
unreadMessages: 0,
activePublicKey: null,
messages: [],
newMessage: ''
@ -59,6 +60,7 @@ async function directMessages(path) {
this.inkey
)
this.customers = data
this.unreadMessages = data.filter(c => c.unread_messages).length
} catch (error) {
LNbits.utils.notifyApiError(error)
}
@ -86,6 +88,7 @@ async function directMessages(path) {
},
selectActiveCustomer: async function () {
await this.getDirectMessages(this.activePublicKey)
await this.getCustomers()
},
focusOnChatBox: function (index) {
setTimeout(() => {