diff --git a/CHANGELOG.md b/CHANGELOG.md index f2997c59d..bf57bd423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.59.2 - 2022-06-22 + +#### Changed + +- Revert Show capture options menu regardless of backend response. #1703 + ## 0.59.1 - 2022-06-22 ### Changed diff --git a/android/app/build.gradle b/android/app/build.gradle index 85033af0b..73b22ebc0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "io.numbersprotocol.capturelite" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 411 - versionName "0.59.1" + versionCode 412 + versionName "0.59.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildFeatures { diff --git a/package-lock.json b/package-lock.json index 6d9e0b868..53b81290d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "capture-lite", - "version": "0.59.1", + "version": "0.59.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "capture-lite", - "version": "0.59.1", + "version": "0.59.2", "dependencies": { "@angular/animations": "^12.2.4", "@angular/cdk": "^12.2.4", diff --git a/package.json b/package.json index 47bfc6c4f..9faaae604 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capture-lite", - "version": "0.59.1", + "version": "0.59.2", "author": "numbersprotocol", "homepage": "https://numbersprotocol.io/", "scripts": { diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index f3fdf4f39..7403f8762 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -332,18 +332,12 @@ export class DetailsPage { ), this.translocoService.selectTranslateObject({ 'message.transferOwnership': null, - 'details.error.transferOwnershipActionIsUnavailable': null, 'message.viewOnCaptureClub': null, - 'details.error.viewOnCaptureClubIsUnavailable': null, 'message.deregisterFromNetwork': null, 'message.mintNftToken': null, - 'details.error.mintNftTokenIsUnavailable': null, 'message.viewBlockchainCertificate': null, - 'details.error.viewBlockchainCertificateIsUnavailable': null, 'message.viewSupportingVideoOnIpfs': null, - 'details.error.viewSupportingVideoOnIpfsIsUnavailable': null, networkActions: null, - 'details.error.networkActionsAreUnavailable': null, }), ]) .pipe( @@ -355,121 +349,83 @@ export class DetailsPage { postCreationWorkflowCompleted, [ messageTransferOwnership, - messageTransferOwnershipIsUnavailable, messageViewOnCaptureClub, - messageviewOnCaptureClubIsUnavailable, messageDeregisterFromNetwork, messageMintNftToken, - messageMintNftTokenIsUnavailable, messageViewBlockchainCertificate, - messageViewBlockchainCertificateIsUnavailable, messageViewSupportingVideoOnIpfs, - messageviewSupportingVideoOnIpfsIsUnavailable, messageNetworkActions, - messageNetworkActionsAreUnavailable, ], ]) => new Promise(resolve => { const buttons: ActionSheetButton[] = []; - buttons.push({ - text: messageViewSupportingVideoOnIpfs, - handler: - postCreationWorkflowCompleted && - diaBackendAsset?.supporting_file - ? () => { - this.openIpfsSupportingVideo(); - } - : () => { - this.errorService - .toastError$( - messageviewSupportingVideoOnIpfsIsUnavailable - ) - .toPromise(); - }, - }); - - buttons.push({ - text: messageTransferOwnership, - handler: - postCreationWorkflowCompleted && detailedCapture.id - ? () => { - this.openContactSelectionDialog(); - resolve(); - } - : () => { - this.errorService - .toastError$(messageTransferOwnershipIsUnavailable) - .toPromise(); - }, - }); - - buttons.push({ - text: messageViewOnCaptureClub, - handler: - diaBackendAsset?.source_type === 'store' - ? () => { - this.openCaptureClub(); - } - : () => { - this.errorService - .toastError$(messageviewOnCaptureClubIsUnavailable) - .toPromise(); - }, - }); + if ( + postCreationWorkflowCompleted && + diaBackendAsset?.supporting_file + ) { + buttons.push({ + text: messageViewSupportingVideoOnIpfs, + handler: () => { + this.openIpfsSupportingVideo(); + }, + }); + } + if (postCreationWorkflowCompleted && detailedCapture.id) { + buttons.push({ + text: messageTransferOwnership, + handler: () => { + this.openContactSelectionDialog(); + resolve(); + }, + }); + } + if (diaBackendAsset?.source_type === 'store') { + buttons.push({ + text: messageViewOnCaptureClub, + handler: () => { + this.openCaptureClub(); + }, + }); + } buttons.push({ text: messageDeregisterFromNetwork, handler: () => { this.remove().then(() => resolve()); }, }); - - buttons.push({ - text: messageMintNftToken, - handler: - postCreationWorkflowCompleted && - diaBackendAsset?.nft_token_id === null - ? () => { - this.mintNft().then(() => resolve()); - } - : () => { - this.errorService - .toastError$(messageMintNftTokenIsUnavailable) - .toPromise(); - }, - role: 'destructive', - }); - buttons.push({ - text: messageViewBlockchainCertificate, - handler: - postCreationWorkflowCompleted && detailedCapture.id - ? () => { - this.openCertificate(); - resolve(); - } - : () => { - this.errorService - .toastError$( - messageViewBlockchainCertificateIsUnavailable - ) - .toPromise(); - }, - }); - buttons.push({ - text: messageNetworkActions, - handler: postCreationWorkflowCompleted - ? () => { - this.router.navigate( - ['actions', { id: detailedCapture.id }], - { relativeTo: this.route } - ); - resolve(); - } - : () => { - this.errorService - .toastError$(messageNetworkActionsAreUnavailable) - .toPromise(); - }, - }); + if ( + postCreationWorkflowCompleted && + diaBackendAsset?.nft_token_id === null + ) { + buttons.push({ + text: messageMintNftToken, + handler: () => { + this.mintNft().then(() => resolve()); + }, + role: 'destructive', + }); + } + if (postCreationWorkflowCompleted && detailedCapture.id) { + buttons.push({ + text: messageViewBlockchainCertificate, + handler: () => { + this.openCertificate(); + resolve(); + }, + }); + } + if (postCreationWorkflowCompleted) { + buttons.push({ + text: messageNetworkActions, + handler: () => { + this.router.navigate( + ['actions', { id: detailedCapture.id }], + { relativeTo: this.route } + ); + resolve(); + }, + }); + } this.actionSheetController .create({ buttons }) .then(sheet => sheet.present());