Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: custom camera back button nav via angular router #2332

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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