add avatar to account
This commit is contained in:
parent
17ecb81f12
commit
9853f2b455
2 changed files with 19 additions and 4 deletions
|
|
@ -34,6 +34,7 @@ const market = async () => {
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
account: null,
|
account: null,
|
||||||
|
accountMetadata: null,
|
||||||
accountDialog: {
|
accountDialog: {
|
||||||
show: false,
|
show: false,
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -106,6 +107,9 @@ const market = async () => {
|
||||||
if (merchants && merchants.length) {
|
if (merchants && merchants.length) {
|
||||||
this.pubkeys = new Set(merchants)
|
this.pubkeys = new Set(merchants)
|
||||||
}
|
}
|
||||||
|
if (this.account) {
|
||||||
|
this.pubkeys.add(this.account.pubkey)
|
||||||
|
}
|
||||||
if (relays && relays.length) {
|
if (relays && relays.length) {
|
||||||
this.relays = new Set([...defaultRelays, ...relays])
|
this.relays = new Set([...defaultRelays, ...relays])
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -243,6 +247,9 @@ const market = async () => {
|
||||||
this.events.map(eventToObj).map(e => {
|
this.events.map(eventToObj).map(e => {
|
||||||
if (e.kind == 0) {
|
if (e.kind == 0) {
|
||||||
this.profiles.set(e.pubkey, e.content)
|
this.profiles.set(e.pubkey, e.content)
|
||||||
|
if (e.pubkey == this.account.pubkey) {
|
||||||
|
this.accountMetadata = this.profiles.get(this.account.pubkey)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
} else if (e.kind == 30018) {
|
} else if (e.kind == 30018) {
|
||||||
//it's a product `d` is the prod. id
|
//it's a product `d` is the prod. id
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,19 @@
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="account" class="bg-transparent q-ma-md">
|
<div v-if="account" class="bg-transparent q-ma-md">
|
||||||
<!-- <q-avatar size="56px" class="q-mb-sm">
|
<q-avatar size="56px" class="q-mb-sm">
|
||||||
<img src="https://cdn.quasar.dev/img/boy-avatar.png" />
|
<img
|
||||||
|
:src="accountMetadata?.picture || '/nostrmarket/static/images/blank-avatar.webp'"
|
||||||
|
/>
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
<div class="text-weight-bold">Razvan Stoenescu</div>
|
{%raw%}
|
||||||
<div>@rstoenescu</div> -->
|
<div class="text-weight-bold">
|
||||||
|
{{ `${account.pubkey.slice(0, 5)}...${account.pubkey.slice(-5)}` }}
|
||||||
|
</div>
|
||||||
|
<div v-if="accountMetadata && accountMetadata.name">
|
||||||
|
{{ accountMetadata.name }}
|
||||||
|
</div>
|
||||||
|
{%endraw%}
|
||||||
<q-btn
|
<q-btn
|
||||||
label="Delete data"
|
label="Delete data"
|
||||||
class="q-mt-md"
|
class="q-mt-md"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue