Skip to content

Commit

Permalink
🎨 Use default info when likerid not found
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Feb 16, 2024
1 parent 54cf20f commit 1f52588
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1131,33 +1131,37 @@ export default class IscnRegisterForm extends Vue {
}
if (this.address) {
try {
const { data } = await this.$axios.get(
getUserInfoMinByAddress(this.address),
)
const iscnOwner = {
name: data?.displayName || this.address,
wallet: [{
content: this.address,
id: 1,
type: 'like',
isOpenOptions: false,
}],
url: [],
likerId: data?.user || '',
authorDescription: data?.description || 'Publisher',
}
this.authors.push(iscnOwner)
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
}
const iscnOwner = await this.fetchUserInfoByAddress(this.address)
this.authors.push(iscnOwner)
}
// ISCN Fee needs Arweave fee to calculate
await this.calculateISCNFee()
this.uploadStatus = ''
}
async fetchUserInfoByAddress(address: any) {
try {
const { data } = await this.$axios.get(getUserInfoMinByAddress(address))
return {
name: data?.displayName || address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: data?.user || '',
authorDescription: data?.description || 'Publisher',
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
return {
name: address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: '',
authorDescription: 'Publisher',
}
}
}
addContentFingerprint() {
this.customContentFingerprints.push(this.contentFingerprintInput)
this.contentFingerprintInput = ''
Expand Down

0 comments on commit 1f52588

Please sign in to comment.