Skip to content

Commit c400671

Browse files
authored
Merge pull request #2332 from numbersprotocol/fix-android-back-button-via-router
fix: custom camera back button nav via angular router
2 parents 7d5b83d + 0ff306c commit c400671

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/app/features/home/custom-camera/custom-camera.page.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Location } from '@angular/common';
33
import { Component, OnDestroy, OnInit } from '@angular/core';
44
import { Router } from '@angular/router';
55
import { Capacitor, PluginListenerHandle } from '@capacitor/core';
6-
import { NavController, Platform } from '@ionic/angular';
6+
import { Platform } from '@ionic/angular';
77
import { UntilDestroy } from '@ngneat/until-destroy';
88
import { CaptureResult, PreviewCamera } from '@numbersprotocol/preview-camera';
99
import { BehaviorSubject, Subscription } from 'rxjs';
@@ -68,8 +68,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
6868
private readonly goProBluetoothService: GoProBluetoothService,
6969
private readonly errorService: ErrorService,
7070
private readonly userGuideService: UserGuideService,
71-
private readonly platform: Platform,
72-
private readonly navCtrl: NavController
71+
private readonly platform: Platform
7372
) {}
7473

7574
ngOnInit() {
@@ -99,7 +98,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
9998
if (this.mode$.value === 'pre-publish') {
10099
this.discardCurrentCapture();
101100
} else {
102-
this.navCtrl.back();
101+
this.leaveCustomCamera();
103102
}
104103
});
105104
}
@@ -242,7 +241,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
242241
}
243242

244243
async leaveCustomCamera() {
245-
return this.location.back();
244+
this.router.navigate(['..']);
246245
}
247246

248247
async captureFromGoPro() {

0 commit comments

Comments
 (0)