feat: show unread count
This commit is contained in:
parent
3a77bee659
commit
5942d135b3
2 changed files with 7 additions and 1 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue