Skip to content

Commit

Permalink
Merge pull request #2726 from numbersprotocol/milestone-v230310(0.77.2)
Browse files Browse the repository at this point in the history
Milestone v230310(0.77.2)
  • Loading branch information
bafu authored Apr 18, 2023
2 parents d9f8764 + 0c13930 commit 9f490be
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 25 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.77.2] - 2023-04-18

### Fixed

1. Fix issue When asset registration is incomplete the asset page will repeatedly reload (#2725)
1. Fix error message for iOS duplicate photo uploads (#2724)

To check the difference between the last releaes and the latest dev status, click the link above.

## [0.77.1] - 2023-04-07
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 771
versionName "0.77.1"
versionCode 772
versionName "0.77.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 771;
CURRENT_PROJECT_VERSION = 772;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.77.1;
MARKETING_VERSION = 0.77.2;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -395,13 +395,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 771;
CURRENT_PROJECT_VERSION = 772;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.77.1;
MARKETING_VERSION = 0.77.2;
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;
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.77.1",
"version": "0.77.2",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down
8 changes: 1 addition & 7 deletions src/app/features/home/custom-camera/custom-camera.page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ChangeDetectionStrategy,
Component,
OnDestroy,
OnInit,
} from '@angular/core';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CameraSource } from '@capacitor/camera';
import { Capacitor, PluginListenerHandle } from '@capacitor/core';
Expand Down Expand Up @@ -40,7 +35,6 @@ type CameraQuality = 'low' | 'hq';
selector: 'app-custom-camera',
templateUrl: './custom-camera.page.html',
styleUrls: ['./custom-camera.page.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomCameraPage implements OnInit, OnDestroy {
private captureVideoFinishedListener?: PluginListenerHandle;
Expand Down
14 changes: 12 additions & 2 deletions src/app/features/home/custom-camera/custom-camera.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,18 @@ export class CustomCameraService {
const mimeType = itemToUpload.mimeType;
await this.captureService.capture({ base64, mimeType, source });
await this.removeFile(filePath);
} catch (error) {
const errMsg = this.translocoService.translate(`error.internetError`);
} catch (error: unknown) {
await this.handleUploadToCaptureError(error);
}
}

private async handleUploadToCaptureError(error: unknown) {
if (error instanceof Error && error.message.startsWith('Tuples existed')) {
const translation = 'customCamera.error.duplicateAsset';
const errorMsg = this.translocoService.translate(translation);
await this.errorService.toastError$(errorMsg).toPromise();
} else {
const errMsg = this.translocoService.translate('error.unknownError');
await this.errorService.toastError$(errMsg).toPromise();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Component, Input } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { UntilDestroy } from '@ngneat/until-destroy';
import { combineLatest, fromEvent, ReplaySubject } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { ReplaySubject, combineLatest, fromEvent } from 'rxjs';
import { distinctUntilChanged, filter, map } from 'rxjs/operators';
import {
CachedQueryJWTToken,
DiaBackendAuthService,
} from '../../../../shared/dia-backend/auth/dia-backend-auth.service';
import { BUBBLE_IFRAME_URL } from '../../../../shared/dia-backend/secret';
import { NetworkService } from '../../../../shared/network/network.service';
import { isNonNullable } from '../../../../utils/rx-operators/rx-operators';
import { DetailedCapture } from '../information/session/information-session.service';

@UntilDestroy()
Expand All @@ -25,8 +26,14 @@ export class DetailsIframeComponent {
if (value) this.detailedCapture$.next(value);
}

private readonly detailedCaptureId$ = this.detailedCapture$.pipe(
map(detailedCapture => detailedCapture.id),
isNonNullable(),
distinctUntilChanged()
);

readonly iframeUrl$ = combineLatest([
this.detailedCapture$,
this.detailedCaptureId$,
this.diaBackendAuthService.cachedQueryJWTToken$,
]).pipe(
map(([detailedCapture, token]) => {
Expand All @@ -46,11 +53,11 @@ export class DetailsIframeComponent {
) {}

private generateIframeUrl(
detailedCapture: DetailedCapture,
detailedCaptureId: string,
token: CachedQueryJWTToken
) {
const params =
`nid=${detailedCapture.id}` +
`nid=${detailedCaptureId}` +
`&token=${token.access}` +
`&refresh_token=${token.refresh}` +
`&from=mycapture`;
Expand Down
5 changes: 4 additions & 1 deletion src/assets/i18n/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@
"customCamera": {
"confirmCapture": "Next",
"max": "Max",
"social": "Social"
"social": "Social",
"error": {
"duplicateAsset": "The asset you are trying to upload already exists on the blockchain. Please try again or contact support."
}
},
"wallets": {
"wallets": "Wallets",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/i18n/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@
"customCamera": {
"confirmCapture": "下一步",
"max": "最佳畫質",
"social": "瀏覽畫質"
"social": "瀏覽畫質",
"error": {
"duplicateAsset": "您嘗試上傳的資產已有上鏈紀錄,請重新嘗試,或聯繫開發團隊取得協助。"
}
},
"wallets": {
"wallets": "錢包",
Expand Down

0 comments on commit 9f490be

Please sign in to comment.