11<template >
2- <div class =" card nft-card" >
2+ <div class =" card nft-card" :class = " {'is-current-owner': accountIsCurrentOwner()} " >
33 <LinkResolver class =" nft-card__skeleton" :route =" type" :param =" id" :link =" link" tag =" div" >
44 <div class =" card-image" v-if =" image" >
55 <span v-if =" emoteCount" class =" card-image__emotes" >
5151</template >
5252
5353<script lang="ts" >
54- import { Component , Prop , Vue } from ' vue-property-decorator' ;
54+ import { Component , Prop , Vue , Watch } from ' vue-property-decorator' ;
5555import { get , update } from ' idb-keyval' ;
56+ import shouldUpdate from ' @/utils/shouldUpdate' ;
5657import { sanitizeIpfsUrl , fetchNFTMetadata , getSanitizer } from ' ../utils' ;
5758import { NFT } from ' ../service/scheme' ;
5859
@@ -74,6 +75,7 @@ export default class GalleryCard extends Vue {
7475 @Prop () public imageType! : string ;
7576 @Prop () public price! : string ;
7677 @Prop () public metadata! : string ;
78+ @Prop () public currentOwner! : string ;
7779
7880 private placeholder = ' /koda300x300.svg' ;
7981
@@ -86,12 +88,27 @@ export default class GalleryCard extends Vue {
8688 this .title = meta .name
8789 } else {
8890 const m = await fetchNFTMetadata ({ metadata: this .metadata } as NFT , getSanitizer (this .metadata , undefined , ' permafrost' ))
89- this .image = getSanitizer (meta .image || ' ' )(meta .image || ' ' )
91+ this .image = getSanitizer (m .image || ' ' )(m .image || ' ' )
9092 this .title = m .name
9193 update (this .metadata , () => m )
9294 }
9395 }
9496 }
97+
98+ @Watch (' accountId' , { immediate: true })
99+ hasAccount(value : string , oldVal : string ) {
100+ if (shouldUpdate (value , oldVal )) {
101+ this .accountIsCurrentOwner ();
102+ }
103+ }
104+
105+ get accountId() {
106+ return this .$store .getters .getAuthAddress ;
107+ }
108+
109+ public accountIsCurrentOwner() {
110+ return this .accountId === this .currentOwner
111+ }
95112}
96113 </script >
97114
@@ -103,6 +120,10 @@ export default class GalleryCard extends Vue {
103120 overflow : hidden ;
104121 box-shadow : 0px 2px 5px 0.5px #d32e79 ;
105122
123+ & .is-current-owner {
124+ box-shadow : 0px 2px 5px 0.5px #41b883 ;
125+ }
126+
106127 .has-text-overflow-ellipsis {
107128 overflow : hidden ;
108129 white-space : nowrap ;
0 commit comments