diff --git a/core/src/components/friends-view/profile.js b/core/src/components/friends-view/profile.js index cbce23f8..5290a3a2 100644 --- a/core/src/components/friends-view/profile.js +++ b/core/src/components/friends-view/profile.js @@ -21,7 +21,7 @@ import { publishData } from '../../../../plugins/plugins/utils/publish-image.js' import { parentEpml } from '../show-plugin.js'; import '../notification-view/popover.js'; import './avatar.js'; -import { setNewTab, setProfileData } from '../../redux/app/app-actions.js'; +import { setNewTab, setProfileData, setSideEffectAction } from '../../redux/app/app-actions.js'; import './profile-modal-update.js'; import { modalHelper } from '../../../../plugins/plugins/utils/publish-modal.js'; @@ -77,10 +77,11 @@ class ProfileQdn extends connect(store)(LitElement) { this.imageUrl = ''; this.dialogOpenedProfile = false this.profileDataVisiting = null; - this.nameVisiting = "" - this.hasName = false - this.resourceExistsVisiting = undefined - this.error = "" + this.nameVisiting = ""; + this.hasName = false; + this.resourceExistsVisiting = undefined; + this.error = ""; + this.getUserAddress = this.getUserAddress.bind(this) } static styles = css` @@ -270,6 +271,13 @@ class ProfileQdn extends connect(store)(LitElement) { overflow: hidden; word-break: break-word; } + .send-message-button { + cursor: pointer; + transition: all 0.2s; + } + .send-message-button:hover { + transform: scale(1.1) + } `; getNodeUrl() { @@ -778,6 +786,20 @@ class ProfileQdn extends connect(store)(LitElement) { } } + async getUserAddress() { + try { + const url = `${this.nodeUrl}/names/${this.nameVisiting}`; + const res = await fetch(url); + const result = await res.json(); + if (result.error === 401) { + return ''; + } else { + return result.owner; + } + } catch (error) { + return ''; + } + } render() { return html` ${this.isSaving || @@ -941,7 +963,92 @@ class ProfileQdn extends connect(store)(LitElement) { >