Skip to content

Commit

Permalink
🎨 Rename confusing name regarding epub thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Feb 16, 2024
1 parent ded3cbe commit d2b9769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ export default class IscnRegisterForm extends Vue {
this.author.authorDescription = 'Author'
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailUrl) as string
this.thumbnailUrl = this.formatArweave(this.epubMetadata.thumbnailArweaveId) as string
if (this.author.name) {
this.authors.push(this.author)
}
Expand Down
12 changes: 6 additions & 6 deletions components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export default class IscnUploadForm extends Vue {
Hash.of(Buffer.from(fileBytes)),
])
epubMetadata.ipfsHash = ipfsHash
epubMetadata.thumbnailIpfsHash = ipfsHash
const fileRecord: any = {
fileName: coverFile.name,
Expand Down Expand Up @@ -590,7 +590,7 @@ export default class IscnUploadForm extends Vue {
const deletedFile = this.fileRecords[index];
this.fileRecords.splice(index, 1);
const indexToDelete = this.epubMetadataList.findIndex(item => item.ipfsHash === deletedFile.ipfsHashList);
const indexToDelete = this.epubMetadataList.findIndex(item => item.thumbnailIpfsHash === deletedFile.ipfsHashList);
if (indexToDelete !== -1) {
this.epubMetadataList.splice(indexToDelete, 1);
}
Expand Down Expand Up @@ -635,9 +635,9 @@ export default class IscnUploadForm extends Vue {
}
if (arweaveId) {
this.sentArweaveTransactionInfo.set(ipfsHash, { transactionHash: '', arweaveId });
const metadata = this.epubMetadataList.find((data: any) => data.ipfsHash === ipfsHash)
const metadata = this.epubMetadataList.find((data: any) => data.thumbnailIpfsHash === ipfsHash)
if (metadata) {
metadata.thumbnailUrl = arweaveId;
metadata.thumbnailArweaveId = arweaveId;
}
}
if (!this.arweaveFeeTargetAddress) {
Expand Down Expand Up @@ -718,9 +718,9 @@ export default class IscnUploadForm extends Vue {
const uploadedData = this.sentArweaveTransactionInfo.get(records.ipfsHash) || {};
this.sentArweaveTransactionInfo.set(records.ipfsHash, { ...uploadedData, arweaveId });
if (tempRecord.fileName.includes('cover.jpeg')) {
const metadata = this.epubMetadataList.find((file: any) => file.ipfsHash === records.ipfsHash)
const metadata = this.epubMetadataList.find((file: any) => file.thum === records.ipfsHash)
if (metadata) {
metadata.thumbnailUrl = arweaveId
metadata.thumbnailArweaveId = arweaveId
}
}
this.$emit('arweaveUploaded', { arweaveId })
Expand Down

0 comments on commit d2b9769

Please sign in to comment.