fix: Vue error

This commit is contained in:
Vlad Stan 2023-03-27 18:00:42 +03:00
parent a719517b9c
commit 7c6feca831
2 changed files with 13 additions and 7 deletions

View file

@ -2,7 +2,7 @@ async function directMessages(path) {
const template = await loadTemplateAsync(path) const template = await loadTemplateAsync(path)
Vue.component('direct-messages', { Vue.component('direct-messages', {
name: 'direct-messages', name: 'direct-messages',
props: ['active-public-key', 'adminkey', 'inkey'], props: ['adminkey', 'inkey'],
template, template,
watch: { watch: {
@ -13,6 +13,7 @@ async function directMessages(path) {
data: function () { data: function () {
return { return {
customers: [], customers: [],
activePublicKey: null,
messages: [], messages: [],
newMessage: '' newMessage: ''
} }
@ -31,10 +32,7 @@ async function directMessages(path) {
this.inkey this.inkey
) )
this.messages = data this.messages = data
console.log(
'### this.messages',
this.messages.map(m => m.message)
)
this.focusOnChatBox(this.messages.length - 1) this.focusOnChatBox(this.messages.length - 1)
} catch (error) { } catch (error) {
LNbits.utils.notifyApiError(error) LNbits.utils.notifyApiError(error)
@ -48,7 +46,6 @@ async function directMessages(path) {
this.inkey this.inkey
) )
this.customers = data this.customers = data
console.log('### customers', this.customers)
} catch (error) { } catch (error) {
LNbits.utils.notifyApiError(error) LNbits.utils.notifyApiError(error)
} }

View file

@ -59,6 +59,15 @@
></stall-list> ></stall-list>
</q-card-section> </q-card-section>
</q-card> </q-card>
<q-card class="q-mt-lg">
<q-card-section>
<div class="row">
<div class="col-2"></div>
<div class="col-8"></div>
<div class="col-2"></div>
</div>
</q-card-section>
</q-card>
</div> </div>
<q-card v-else> <q-card v-else>
<q-card-section> <q-card-section>
@ -133,10 +142,10 @@
</div> </div>
<div v-if="merchant && merchant.id" class="col-12"> <div v-if="merchant && merchant.id" class="col-12">
<direct-messages <direct-messages
:active-public-key="activeChatCustomer"
:inkey="g.user.wallets[0].inkey" :inkey="g.user.wallets[0].inkey"
:adminkey="g.user.wallets[0].adminkey" :adminkey="g.user.wallets[0].adminkey"
> >
<!-- :active-public-key="activeChatCustomer" -->
</direct-messages> </direct-messages>
</div> </div>
</div> </div>