diff --git a/core/src/components/friends-view/profile-modal-update.js b/core/src/components/friends-view/profile-modal-update.js index 8371c3a3..3b48513b 100644 --- a/core/src/components/friends-view/profile-modal-update.js +++ b/core/src/components/friends-view/profile-modal-update.js @@ -237,9 +237,11 @@ class ProfileModalUpdate extends connect(store)(LitElement) { changedProperties.has('editContent') && this.editContent ) { - this.bio = this.editContent.bio ?? ''; - this.tagline = this.editContent.tagline ?? ''; - this.wallets = this.editContent.wallets ?? {}; + const {bio, tagline, wallets, customData} = this.editContent + this.bio = bio ?? ''; + this.tagline = tagline ?? ''; + this.wallets = wallets ?? {}; + this.customData = {...customData} this.requestUpdate(); } } @@ -353,6 +355,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) { tagline: this.tagline, bio: this.bio, wallets: this.wallets, + customData: this.customData }; await this.onSubmit(data); this.setIsOpen(false); @@ -378,6 +381,22 @@ class ProfileModalUpdate extends connect(store)(LitElement) { const copyObj = {...this.customData} copyObj[this.newCustomDataKey] = this.newCustomDataField this.customData = copyObj + this.newCustomDataKey = "" + this.newCustomDataField = {}; + this.newFieldName = '' + this.isOpenCustomDataModal = false; + } + + updateCustomData(key, data){ + this.isOpenCustomDataModal = true + this.newCustomDataField = data + this.newCustomDataKey = key + + } + removeCustomData(key){ + const copyObj = {...this.customData} + delete copyObj[key] + this.customData = copyObj } render() { @@ -472,6 +491,40 @@ class ProfileModalUpdate extends connect(store)(LitElement) { `; })} +
+ ${Object.keys(this.customData).map((key) => { + return html` +
+ +
+

+ ${key} +

+ + + this.updateCustomData(key,this.customData[key])} + style="color:var(--black);cursor:pointer" + >edit + + this.removeCustomData(key)} + style="color:var(--black);cursor:pointer" + >remove +
+
+ `; + })} +