From 13784b1de5384f5dea58011291720270d9d3492f Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Wed, 23 Nov 2022 16:46:16 +0800 Subject: [PATCH 1/2] fix: custom camera back button nav via angular router --- src/app/features/home/custom-camera/custom-camera.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/features/home/custom-camera/custom-camera.page.ts b/src/app/features/home/custom-camera/custom-camera.page.ts index 41a674e95..bd8dd346b 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.ts +++ b/src/app/features/home/custom-camera/custom-camera.page.ts @@ -242,7 +242,7 @@ export class CustomCameraPage implements OnInit, OnDestroy { } async leaveCustomCamera() { - return this.location.back(); + this.router.navigate(['..']); } async captureFromGoPro() { From 0ff306c7ba0531e2eb1647abdc592d7c698d96ed Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Wed, 23 Nov 2022 16:54:02 +0800 Subject: [PATCH 2/2] fix: custom camera android back button nav via angular router --- src/app/features/home/custom-camera/custom-camera.page.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/features/home/custom-camera/custom-camera.page.ts b/src/app/features/home/custom-camera/custom-camera.page.ts index bd8dd346b..fb09509ac 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.ts +++ b/src/app/features/home/custom-camera/custom-camera.page.ts @@ -3,7 +3,7 @@ import { Location } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { Capacitor, PluginListenerHandle } from '@capacitor/core'; -import { NavController, Platform } from '@ionic/angular'; +import { Platform } from '@ionic/angular'; import { UntilDestroy } from '@ngneat/until-destroy'; import { CaptureResult, PreviewCamera } from '@numbersprotocol/preview-camera'; import { BehaviorSubject, Subscription } from 'rxjs'; @@ -68,8 +68,7 @@ export class CustomCameraPage implements OnInit, OnDestroy { private readonly goProBluetoothService: GoProBluetoothService, private readonly errorService: ErrorService, private readonly userGuideService: UserGuideService, - private readonly platform: Platform, - private readonly navCtrl: NavController + private readonly platform: Platform ) {} ngOnInit() { @@ -99,7 +98,7 @@ export class CustomCameraPage implements OnInit, OnDestroy { if (this.mode$.value === 'pre-publish') { this.discardCurrentCapture(); } else { - this.navCtrl.back(); + this.leaveCustomCamera(); } }); }