Skip to content

Commit

Permalink
🔀 Merge main updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Dec 22, 2023
2 parents c6ac282 + a0d2931 commit e007d73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export default class UploadForm extends Vue {
this.sentArweaveTransactionInfo.set(records.ipfsHash, { ...uploadedData, arweaveId });
if (tempRecord.fileName.includes('cover.jpeg')) {
const metadata = this.epubMetadataList.find((file: any) => file.ipfsHash === records.ipfsHash)
if (metadata && metadata.thumbnailUrl) {
if (metadata) {
metadata.thumbnailUrl = arweaveId
}
}
Expand Down
12 changes: 6 additions & 6 deletions pages/view/_iscnId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,12 @@ export enum ExifList {
content: description,
},
],
script: schema ? [
{
script: schema ? [{
hid: 'schema',
innerHTML: JSON.stringify(schema),
type: 'application/ld+json',
body: true,
},
] : undefined,
}] : undefined,
} as MetaInfo
},
filters: { ellipsis },
Expand Down Expand Up @@ -916,8 +914,10 @@ export default class ViewIscnIdPage extends Vue {
handleCopyIscnId() {
logTrackerEvent(this, 'ISCNView', 'CopyISCNID', this.iscnId, 1)
const iscnIdPrefix = extractIscnIdPrefix(this.iscnId)
copyToClipboard(iscnIdPrefix)
this.isOpenCopiedAlert = true
if (iscnIdPrefix) {
copyToClipboard(iscnIdPrefix)
this.isOpenCopiedAlert = true
}
}
}
</script>
3 changes: 2 additions & 1 deletion utils/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export function copyToClipboard(text){
document.body.removeChild(copyText);
}


export function extractIscnIdPrefix(iscnId) {
const regex = /^(iscn:\/\/likecoin-chain\/[^/]+)/;
const match = iscnId.match(regex);
if (match && match[1]) {
return match[1];
}
return null;
}
}

0 comments on commit e007d73

Please sign in to comment.