Skip to content

Commit

Permalink
Merge pull request #1649 from numbersprotocol/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
shc261392 authored May 30, 2022
2 parents 3979f85 + 8e42bfd commit fb0a44a
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 17 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ 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.57.3 - 2022-05-27

### Fixed

- Fix sign up page errors to be more specific
- Fix user guide for highlighting capture less persistant

## Changed

- Change share referral code text

## 0.57.2 - 2022-05-24

### Fixed
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 395
versionName "0.57.2"
versionCode 396
versionName "0.57.3"
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.57.2",
"version": "0.57.3",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/app/features/settings/user-guide/user-guide.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
(ionChange)="setHasCapturedVideoWithCustomCamera($event)"
></ion-checkbox>
</ion-item>
<ion-item>
<ion-label text-wrap>Has Highlighted First Capture</ion-label>
<ion-checkbox
slot="end"
[checked]="hasHighlightedFirstCapture$ | ngrxPush"
(ionChange)="setHasHighlightedFirstCapture($event)"
></ion-checkbox>
</ion-item>
<ion-item>
<ion-label text-wrap>Has Opened Details Page</ion-label>
<ion-checkbox
Expand Down
8 changes: 8 additions & 0 deletions src/app/features/settings/user-guide/user-guide.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export class UserGuidePage {
readonly hasCapturedVideoWithCustomCamera$ =
this.userGuideService.hasCapturedVideoWithCustomCamera$();

readonly hasHighlightedFirstCapture$ =
this.userGuideService.hasHighlightedFirstCapture$();

readonly hasOpenedDetailsPage$ =
this.userGuideService.hasOpenedDetailsPage$();

Expand Down Expand Up @@ -58,6 +61,10 @@ export class UserGuidePage {
);
}

setHasHighlightedFirstCapture(event: any) {
this.userGuideService.setHasHighlightedFirstCapture(event.detail.checked);
}

setHasOpenedDetailsPage(event: any) {
this.userGuideService.setHasOpenedDetailsPage(event.detail.checked);
}
Expand Down Expand Up @@ -90,6 +97,7 @@ export class UserGuidePage {
this.userGuideService.setHasOpenedCustomCameraPage(false);
this.userGuideService.setHasCapturedPhotoWithCustomCamera(false);
this.userGuideService.setHasCapturedVideoWithCustomCamera(false);
this.userGuideService.setHasHighlightedFirstCapture(false);
this.userGuideService.setHasOpenedDetailsPage(false);
this.userGuideService.setHasClickedDetailsPageOptionsMenu(false);
this.userGuideService.setHasHighligtedActivityButton(false);
Expand Down
26 changes: 24 additions & 2 deletions src/app/features/signup/signup.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,30 @@ export class SignupPage {
)
),
catchError((err: unknown) => {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
if (err instanceof HttpErrorResponse && err.status === 400) {
if (
err instanceof HttpErrorResponse &&
err.error.error?.type === 'duplicate_email'
) {
return this.errorService.toastError$(
this.translocoService.translate(
'error.diaBackend.duplicate_email'
)
);
}
if (
err instanceof HttpErrorResponse &&
err.error.error?.details?.username?.length > 0
) {
return this.errorService.toastError$(
this.translocoService.translate(
'error.diaBackend.duplicate_username'
)
);
}
if (
err instanceof HttpErrorResponse &&
err.error.error?.type === 'invalid_referral_code'
) {
return this.errorService.toastError$(
this.translocoService.translate(
'error.diaBackend.invalid_referral_code'
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/error/error.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class ErrorService {
timeoutError,
unknownError,
}) => {
// eslint-disable-next-line no-debugger
if (typeof error === 'string') return error;
if (error instanceof HttpErrorResponse) {
if (error.status === HttpErrorCode.INVALID)
Expand Down
9 changes: 4 additions & 5 deletions src/app/shared/share/share.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ export class ShareService {

async shareReferralCode(referralCode: string) {
const text = this.translocoService.translate(
'invitation.myReferralCodeAtCaptureAppIs',
'invitation.useMyReferralCodeToSignUpForCaptureAppPassVerificationAndWeBothGetNumPointsReward',
{ referralCode: referralCode }
);
return Share.share({
text: text,
url: 'https://www.numbersprotocol.io/#products',
});

const urlToDownloadApp = 'https://www.numbersprotocol.io/#products';
return Share.share({ text: text + '\n' + urlToDownloadApp });
}
}
25 changes: 24 additions & 1 deletion src/app/shared/user-guide/user-guide.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ export class UserGuideService {
customTexts: this.customTexts,
});
this.setHasHighlightedCameraTab(true);
} else if ((await this.hasOpenedDetailsPage()) === false) {
} else if ((await this.hasHighlightedFirstCapture()) === false) {
await this.delayBeforeStartTour();
this.joyrideService.startTour({
steps: ['highlightFirstCapture'],
showCounter: this.showCounter,
customTexts: this.customTexts,
});
this.setHasHighlightedFirstCapture(true);
} else if (
(await this.hasClickedDetailsPageOptionsMenu()) === true &&
(await this.hasHighligtedActivityButton()) === false
Expand Down Expand Up @@ -223,6 +224,27 @@ export class UserGuideService {
);
}

hasHighlightedFirstCapture$() {
return this.preferences.getBoolean$(
PrefKeys.HAS_HIGHLIGHTED_FIRST_CAPTURE,
false
);
}

async hasHighlightedFirstCapture() {
return await this.preferences.getBoolean(
PrefKeys.HAS_HIGHLIGHTED_FIRST_CAPTURE,
false
);
}

async setHasHighlightedFirstCapture(value: boolean) {
return await this.preferences.setBoolean(
PrefKeys.HAS_HIGHLIGHTED_FIRST_CAPTURE,
value
);
}

hasOpenedDetailsPage$() {
return this.preferences.getBoolean$(
PrefKeys.HAS_OPENED_DETAILS_PAGE,
Expand Down Expand Up @@ -363,6 +385,7 @@ const enum PrefKeys {
HAS_OPENED_CUSTOM_CAMERA_PAGE = 'HAS_OPENED_CUSTOM_CAMERA_PAGE',
HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA = 'HAS_CAPTURED_PHOTO_WITH_CUSTOM_CAMERA',
HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA = 'HAS_CAPTURED_VIDEO_WITH_CUSTOM_CAMERA',
HAS_HIGHLIGHTED_FIRST_CAPTURE = 'HAS_HIGHLIGHTED_FIRST_CAPTURE',
HAS_OPENED_DETAILS_PAGE = 'HAS_OPENED_DETAILS_PAGE',
HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU = 'HAS_CLICKED_DETAILS_PAGE_OPTIONS_MENU',
HAS_OPENED_ACTIVITIES_PAGE = 'HAS_OPENED_ACTIVITIES_PAGE',
Expand Down
6 changes: 4 additions & 2 deletions src/assets/i18n/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@
"unable_to_confirm_order": "Unable to confirm order. Please try again.",
"unpaid_num_exceed_threshold": "Too much unpaid NUM. Please contact us with email to restore account functionality.",
"invalid_network_app_name": "Invalid network app.",
"invalid_referral_code": "Invalide referral code"
"invalid_referral_code": "Invalid referral code",
"duplicate_email": "The email has already been registered",
"duplicate_username": "User with this username already exists"
},
"wallets": {
"emptyTransferAmount": "Please enter a valid transfer amount.",
Expand Down Expand Up @@ -280,7 +282,7 @@
"invitation": "Invitation",
"shareInvitationCode": "Share invitation code",
"shareToGetRewarded": "Share to get rewarded",
"myReferralCodeAtCaptureAppIs": "My referral code at Capture App is {{referralCode}}"
"useMyReferralCodeToSignUpForCaptureAppPassVerificationAndWeBothGetNumPointsReward": "Use my referral code {{referralCode}} to sign up for Capture App, pass verification and we both get NUM Points reward!"
},
"gopro": {
"setup": "GoPro Setup",
Expand Down
6 changes: 4 additions & 2 deletions src/assets/i18n/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@
"unable_to_confirm_order": "無法確認訂單。請再試一次。",
"unpaid_num_exceed_threshold": "太多未付的 NUM。請通過電子郵件與我們聯繫以恢復帳戶功能。",
"invalid_network_app_name": "無效的網絡動作。",
"invalid_referral_code": "無效的推薦代碼"
"invalid_referral_code": "無效的推薦代碼",
"duplicate_email": "該電子郵件已註冊",
"duplicate_username": "用戶名已被其他使用者使用"
},
"wallets": {
"emptyTransferAmount": "請輸入有效轉帳金額。",
Expand Down Expand Up @@ -280,7 +282,7 @@
"invitation": "邀請",
"shareInvitationCode": "分享邀請碼",
"shareToGetRewarded": "分享以獲得獎勵",
"myReferralCodeAtCaptureAppIs": "我在 Capture App 的推薦代碼是 {{referralCode}}"
"useMyReferralCodeToSignUpForCaptureAppPassVerificationAndWeBothGetNumPointsReward": "透過我的推薦碼 {{referralCode}} 在 Capture App 註冊,一起獲得 NUM Points!"
},
"gopro": {
"setup": "GoPro 設置",
Expand Down

0 comments on commit fb0a44a

Please sign in to comment.