Skip to content

Commit fd9054d

Browse files
authored
Merge pull request #1730 from numbersprotocol/revert-show-capture-actions-regardleess-of-backend-response
Revert show capture actions regardleess of backend response
2 parents 58a13c7 + be9eb5b commit fd9054d

File tree

5 files changed

+72
-110
lines changed

5 files changed

+72
-110
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.59.2 - 2022-06-22
9+
10+
#### Changed
11+
12+
- Revert Show capture options menu regardless of backend response. #1703
13+
814
## 0.59.1 - 2022-06-22
915

1016
### Changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "io.numbersprotocol.capturelite"
77
minSdkVersion rootProject.ext.minSdkVersion
88
targetSdkVersion rootProject.ext.targetSdkVersion
9-
versionCode 411
10-
versionName "0.59.1"
9+
versionCode 412
10+
versionName "0.59.2"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildFeatures {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-lite",
3-
"version": "0.59.1",
3+
"version": "0.59.2",
44
"author": "numbersprotocol",
55
"homepage": "https://numbersprotocol.io/",
66
"scripts": {

src/app/features/home/details/details.page.ts

Lines changed: 61 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -332,18 +332,12 @@ export class DetailsPage {
332332
),
333333
this.translocoService.selectTranslateObject({
334334
'message.transferOwnership': null,
335-
'details.error.transferOwnershipActionIsUnavailable': null,
336335
'message.viewOnCaptureClub': null,
337-
'details.error.viewOnCaptureClubIsUnavailable': null,
338336
'message.deregisterFromNetwork': null,
339337
'message.mintNftToken': null,
340-
'details.error.mintNftTokenIsUnavailable': null,
341338
'message.viewBlockchainCertificate': null,
342-
'details.error.viewBlockchainCertificateIsUnavailable': null,
343339
'message.viewSupportingVideoOnIpfs': null,
344-
'details.error.viewSupportingVideoOnIpfsIsUnavailable': null,
345340
networkActions: null,
346-
'details.error.networkActionsAreUnavailable': null,
347341
}),
348342
])
349343
.pipe(
@@ -355,121 +349,83 @@ export class DetailsPage {
355349
postCreationWorkflowCompleted,
356350
[
357351
messageTransferOwnership,
358-
messageTransferOwnershipIsUnavailable,
359352
messageViewOnCaptureClub,
360-
messageviewOnCaptureClubIsUnavailable,
361353
messageDeregisterFromNetwork,
362354
messageMintNftToken,
363-
messageMintNftTokenIsUnavailable,
364355
messageViewBlockchainCertificate,
365-
messageViewBlockchainCertificateIsUnavailable,
366356
messageViewSupportingVideoOnIpfs,
367-
messageviewSupportingVideoOnIpfsIsUnavailable,
368357
messageNetworkActions,
369-
messageNetworkActionsAreUnavailable,
370358
],
371359
]) =>
372360
new Promise<void>(resolve => {
373361
const buttons: ActionSheetButton[] = [];
374-
buttons.push({
375-
text: messageViewSupportingVideoOnIpfs,
376-
handler:
377-
postCreationWorkflowCompleted &&
378-
diaBackendAsset?.supporting_file
379-
? () => {
380-
this.openIpfsSupportingVideo();
381-
}
382-
: () => {
383-
this.errorService
384-
.toastError$(
385-
messageviewSupportingVideoOnIpfsIsUnavailable
386-
)
387-
.toPromise();
388-
},
389-
});
390-
391-
buttons.push({
392-
text: messageTransferOwnership,
393-
handler:
394-
postCreationWorkflowCompleted && detailedCapture.id
395-
? () => {
396-
this.openContactSelectionDialog();
397-
resolve();
398-
}
399-
: () => {
400-
this.errorService
401-
.toastError$(messageTransferOwnershipIsUnavailable)
402-
.toPromise();
403-
},
404-
});
405-
406-
buttons.push({
407-
text: messageViewOnCaptureClub,
408-
handler:
409-
diaBackendAsset?.source_type === 'store'
410-
? () => {
411-
this.openCaptureClub();
412-
}
413-
: () => {
414-
this.errorService
415-
.toastError$(messageviewOnCaptureClubIsUnavailable)
416-
.toPromise();
417-
},
418-
});
362+
if (
363+
postCreationWorkflowCompleted &&
364+
diaBackendAsset?.supporting_file
365+
) {
366+
buttons.push({
367+
text: messageViewSupportingVideoOnIpfs,
368+
handler: () => {
369+
this.openIpfsSupportingVideo();
370+
},
371+
});
372+
}
373+
if (postCreationWorkflowCompleted && detailedCapture.id) {
374+
buttons.push({
375+
text: messageTransferOwnership,
376+
handler: () => {
377+
this.openContactSelectionDialog();
378+
resolve();
379+
},
380+
});
381+
}
382+
if (diaBackendAsset?.source_type === 'store') {
383+
buttons.push({
384+
text: messageViewOnCaptureClub,
385+
handler: () => {
386+
this.openCaptureClub();
387+
},
388+
});
389+
}
419390
buttons.push({
420391
text: messageDeregisterFromNetwork,
421392
handler: () => {
422393
this.remove().then(() => resolve());
423394
},
424395
});
425-
426-
buttons.push({
427-
text: messageMintNftToken,
428-
handler:
429-
postCreationWorkflowCompleted &&
430-
diaBackendAsset?.nft_token_id === null
431-
? () => {
432-
this.mintNft().then(() => resolve());
433-
}
434-
: () => {
435-
this.errorService
436-
.toastError$(messageMintNftTokenIsUnavailable)
437-
.toPromise();
438-
},
439-
role: 'destructive',
440-
});
441-
buttons.push({
442-
text: messageViewBlockchainCertificate,
443-
handler:
444-
postCreationWorkflowCompleted && detailedCapture.id
445-
? () => {
446-
this.openCertificate();
447-
resolve();
448-
}
449-
: () => {
450-
this.errorService
451-
.toastError$(
452-
messageViewBlockchainCertificateIsUnavailable
453-
)
454-
.toPromise();
455-
},
456-
});
457-
buttons.push({
458-
text: messageNetworkActions,
459-
handler: postCreationWorkflowCompleted
460-
? () => {
461-
this.router.navigate(
462-
['actions', { id: detailedCapture.id }],
463-
{ relativeTo: this.route }
464-
);
465-
resolve();
466-
}
467-
: () => {
468-
this.errorService
469-
.toastError$(messageNetworkActionsAreUnavailable)
470-
.toPromise();
471-
},
472-
});
396+
if (
397+
postCreationWorkflowCompleted &&
398+
diaBackendAsset?.nft_token_id === null
399+
) {
400+
buttons.push({
401+
text: messageMintNftToken,
402+
handler: () => {
403+
this.mintNft().then(() => resolve());
404+
},
405+
role: 'destructive',
406+
});
407+
}
408+
if (postCreationWorkflowCompleted && detailedCapture.id) {
409+
buttons.push({
410+
text: messageViewBlockchainCertificate,
411+
handler: () => {
412+
this.openCertificate();
413+
resolve();
414+
},
415+
});
416+
}
417+
if (postCreationWorkflowCompleted) {
418+
buttons.push({
419+
text: messageNetworkActions,
420+
handler: () => {
421+
this.router.navigate(
422+
['actions', { id: detailedCapture.id }],
423+
{ relativeTo: this.route }
424+
);
425+
resolve();
426+
},
427+
});
428+
}
473429
this.actionSheetController
474430
.create({ buttons })
475431
.then(sheet => sheet.present());

0 commit comments

Comments
 (0)