Skip to content

Commit

Permalink
Merge pull request #1732 from numbersprotocol/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
shc261392 authored Jun 22, 2022
2 parents 8abb15a + fd9054d commit 86cfbd2
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 110 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capture-lite",
"version": "0.59.1",
"version": "0.59.2",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down
166 changes: 61 additions & 105 deletions src/app/features/home/details/details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -355,121 +349,83 @@ export class DetailsPage {
postCreationWorkflowCompleted,
[
messageTransferOwnership,
messageTransferOwnershipIsUnavailable,
messageViewOnCaptureClub,
messageviewOnCaptureClubIsUnavailable,
messageDeregisterFromNetwork,
messageMintNftToken,
messageMintNftTokenIsUnavailable,
messageViewBlockchainCertificate,
messageViewBlockchainCertificateIsUnavailable,
messageViewSupportingVideoOnIpfs,
messageviewSupportingVideoOnIpfsIsUnavailable,
messageNetworkActions,
messageNetworkActionsAreUnavailable,
],
]) =>
new Promise<void>(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());
Expand Down

0 comments on commit 86cfbd2

Please sign in to comment.