update profile if name exists

This commit is contained in:
PhilReact 2023-11-04 19:18:57 +02:00
parent fea3d16bcc
commit 5d44f3e378

View File

@ -42,7 +42,8 @@ class ProfileQdn extends connect(store)(LitElement) {
imageUrl: { type: String }, imageUrl: { type: String },
dialogOpenedProfile: {type: Boolean}, dialogOpenedProfile: {type: Boolean},
profileDataVisiting: {type: Object}, profileDataVisiting: {type: Object},
nameVisiting: {type: String} nameVisiting: {type: String},
hasName: {type: Boolean}
}; };
} }
@ -74,6 +75,7 @@ class ProfileQdn extends connect(store)(LitElement) {
this.dialogOpenedProfile = false this.dialogOpenedProfile = false
this.profileDataVisiting = null; this.profileDataVisiting = null;
this.nameVisiting = "" this.nameVisiting = ""
this.hasName = false
} }
static styles = css` static styles = css`
@ -370,6 +372,7 @@ class ProfileQdn extends connect(store)(LitElement) {
this.name = null; this.name = null;
throw new Error('no name'); throw new Error('no name');
} }
this.hasName = true
const name = nameObject.name; const name = nameObject.name;
this.imageUrl = `${this.nodeUrl}/arbitrary/THUMBNAIL/${name}/qortal_avatar?async=true&apiKey=${this.myNode.apiKey}`; this.imageUrl = `${this.nodeUrl}/arbitrary/THUMBNAIL/${name}/qortal_avatar?async=true&apiKey=${this.myNode.apiKey}`;
this.name = name; this.name = name;
@ -438,6 +441,14 @@ class ProfileQdn extends connect(store)(LitElement) {
this.getProfile(); this.getProfile();
} }
} }
if (
state.app.accountInfo &&
state.app.accountInfo.names.length &&
state.app.nodeStatus &&
state.app.nodeStatus.syncPercent === 100 && this.hasName === false && this.hasAttemptedToFetchResource && state.app.accountInfo && state.app.accountInfo.names && state.app.accountInfo.names.length > 0
) {
this.getProfile();
}
} }
async getArbitraryFee() { async getArbitraryFee() {