From 85f079c820aa4616c9799d3a75540d7080f55f67 Mon Sep 17 00:00:00 2001 From: William Chong Date: Thu, 16 Jan 2025 17:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Set=20DRM=20option=20on=20ISCN?= =?UTF-8?q?=20update=20if=20current=20is=20enabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/IscnRegisterForm.vue | 8 ++++++-- pages/edit/_iscnId.vue | 14 +++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index 6e3d254e..b865e7fc 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -300,7 +300,7 @@ :label="$t('IscnRegisterForm.label.drm')" class="mb-[12px]" > - + {{ $t('IscnRegisterForm.label.drm.details') }} @@ -813,7 +813,7 @@ export default class IscnRegisterForm extends Vue { isRegisterNumbersProtocolAsset = false numbersProtocolAssetIds = new Map() - isUseArweaveLink= false + isUseArweaveLinkChecked= false isOpenFileInfoDialog = false isOpenAuthorDialog = false isOpenWarningSnackbar = false @@ -836,6 +836,10 @@ export default class IscnRegisterForm extends Vue { language: string = '' shouldShowMoreSettings: boolean = false + get isUseArweaveLink() { + return this.shouldShowDRMOption && this.isUseArweaveLinkChecked + } + get ipfsHashList() { const list = [] if (this.ipfsHash) { diff --git a/pages/edit/_iscnId.vue b/pages/edit/_iscnId.vue index 4df37122..64c040c9 100644 --- a/pages/edit/_iscnId.vue +++ b/pages/edit/_iscnId.vue @@ -50,7 +50,7 @@ :label="$t('IscnRegisterForm.label.drm')" class="mb-[12px]" > - + {{ $t('IscnRegisterForm.label.drm.details') }} @@ -251,6 +251,7 @@ import { ISCN_PREFIX, ISCN_GAS_FEE, UPDATE_ISCN_GAS_MULTIPLIER } from '~/constan import { logTrackerEvent } from '~/utils/logger' import { signISCN } from '~/utils/cosmos/iscn/sign' import { extractIscnIdPrefix } from '~/utils/ui' +import { LIKE_CO_API_ROOT } from '~/constant/api'; const walletModule = namespace('wallet') @@ -300,7 +301,7 @@ export default class EditIscnPage extends Vue { publisher: string = '' datePublished: string = '' - isUseArweaveLink= false + isUseArweaveLinkChecked = false shouldShowUploadSection: boolean = false shouldShowMoreSettings: boolean = false uploadFileRecords: any = null @@ -318,6 +319,10 @@ export default class EditIscnPage extends Vue { latestVersion: number | string = '' + get isUseArweaveLink() { + return this.shouldShowDRMOption && this.isUseArweaveLinkChecked + } + get combinedArweaveIdList() { return this.uploadArweaveIdList || [] } @@ -355,7 +360,7 @@ export default class EditIscnPage extends Vue { if (this.combinedArweaveLinks.length) { array.push(...this.combinedArweaveLinks) } - if (!this.isUseArweaveLink && this.uploadIpfsHashList.length) { + if (!this.isUseArweaveLinkChecked && this.uploadIpfsHashList.length) { array.push(...this.uploadIpfsHashList.map((ipfs) => this.formatIpfs(ipfs) as string)) } if (this.customContentFingerprints.length) { @@ -401,6 +406,9 @@ export default class EditIscnPage extends Vue { this.isbn = this.contentMetadata.isbn || '' this.publisher = this.contentMetadata.publisher || '' this.datePublished = this.contentMetadata.datePublished || '' + this.isUseArweaveLinkChecked = !!this.contentFingerprints.find( + link => link.startsWith(LIKE_CO_API_ROOT), + ) } }