feat: show unread count
This commit is contained in:
parent
3a77bee659
commit
5942d135b3
2 changed files with 7 additions and 1 deletions
|
|
@ -2,9 +2,12 @@
|
|||
<q-card>
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="col-2">
|
||||
<h6 class="text-subtitle1 q-my-none">Messages</h6>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<q-badge v-if="unreadMessages" color="green"><span v-text="unreadMessages"></span> new</q-badge>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-btn
|
||||
v-if="activePublicKey"
|
||||
|
|
|
|||
|
|
@ -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