Skip to content

Commit

Permalink
Merge pull request #2332 from numbersprotocol/fix-android-back-button…
Browse files Browse the repository at this point in the history
…-via-router

fix: custom camera back button nav via angular router
  • Loading branch information
bafu authored Nov 29, 2022
2 parents 7d5b83d + 0ff306c commit c400671
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/app/features/home/custom-camera/custom-camera.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -99,7 +98,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
if (this.mode$.value === 'pre-publish') {
this.discardCurrentCapture();
} else {
this.navCtrl.back();
this.leaveCustomCamera();
}
});
}
Expand Down Expand Up @@ -242,7 +241,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
}

async leaveCustomCamera() {
return this.location.back();
this.router.navigate(['..']);
}

async captureFromGoPro() {
Expand Down

0 comments on commit c400671

Please sign in to comment.