Skip to content

Commit

Permalink
🔀 Merge #440 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Feb 15, 2024
2 parents cddd45d + 54cf20f commit bbae5b7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 29 deletions.
69 changes: 40 additions & 29 deletions components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ import { estimateISCNTxGasAndFee, formatISCNTxPayload } from '~/utils/cosmos/isc
import { ISCN_GAS_MULTIPLIER } from '~/constant';
import {
getLikerIdMinApi,
getUserInfoMinByAddress,
API_POST_NUMBERS_PROTOCOL_ASSETS,
} from '~/constant/api';
import { getAccountBalance } from '~/utils/cosmos'
Expand Down Expand Up @@ -1114,38 +1115,48 @@ export default class IscnRegisterForm extends Vue {
}
async mounted() {
if (this.epubMetadata) {
this.name = this.epubMetadata.title;
this.description = this.extractText(this.epubMetadata.description);
this.author.name = this.epubMetadata.author;
this.author.authorDescription = 'Author'
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailUrl) as string
if (this.author.name) {
this.authors.push(this.author)
this.uploadStatus = 'loading'
if (this.epubMetadata) {
this.name = this.epubMetadata.title;
this.description = this.extractText(this.epubMetadata.description);
this.author.name = this.epubMetadata.author;
this.author.authorDescription = 'Author'
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailUrl) as string
if (this.author.name) {
this.authors.push(this.author)
}
}
}
if (this.address) {
const iscnOwner = {
name: this.$t('iscn.meta.stakeholders.name.placeholder') as string,
wallet: [{
content: this.address,
id: 1,
type: 'like',
isOpenOptions: false,
}],
url: [],
likerId: '',
authorDescription: 'ISCN owner',
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)
}
}
this.authors.push(iscnOwner)
// ISCN Fee needs Arweave fee to calculate
await this.calculateISCNFee()
this.uploadStatus = ''
}
this.uploadStatus = 'loading'
// ISCN Fee needs Arweave fee to calculate
await this.calculateISCNFee()
this.uploadStatus = ''
}
addContentFingerprint() {
this.customContentFingerprints.push(this.contentFingerprintInput)
Expand Down
3 changes: 3 additions & 0 deletions components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@ export default class UploadForm extends Vue {
tempRecord.transactionHash = transactionHash
if (!tempRecord.transactionHash) {
tempRecord.transactionHash = await this.sendArweaveFeeTx(tempRecord);
if (!tempRecord.transactionHash) {
throw new Error('TRANSACTION_NOT_SENT')
}
}
try {
Expand Down

0 comments on commit bbae5b7

Please sign in to comment.