Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #7991: Opening in private using app context menu or shortcut widg…
Browse files Browse the repository at this point in the history
…et does not respect biometrics toggle (#7992)

Adding private lock case to the external link open
  • Loading branch information
soner-yuksel authored and iccub committed Aug 29, 2023
1 parent 5f37b47 commit 0ea93cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Sources/Brave/Frontend/Browser/NavigationRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ public enum NavigationPath: Equatable {
if Preferences.Privacy.lockWithPasscode.value {
bvc.openBlankNewTab(attemptLocationFieldFocus: false, isPrivate: true)
} else {
bvc.askForLocalAuthentication(viewType: .widget) { [weak bvc] success, _ in
if success {
bvc?.openBlankNewTab(attemptLocationFieldFocus: false, isPrivate: true)
if Preferences.Privacy.privateBrowsingLock.value {
bvc.askForLocalAuthentication(viewType: .widget) { [weak bvc] success, _ in
if success {
bvc?.openBlankNewTab(attemptLocationFieldFocus: false, isPrivate: true)
}
}
} else {
bvc.openBlankNewTab(attemptLocationFieldFocus: false, isPrivate: true)
}
}
case .bookmarks:
Expand Down
10 changes: 7 additions & 3 deletions Sources/Brave/Frontend/Browser/QuickActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ public class QuickActions: NSObject {
if Preferences.Privacy.lockWithPasscode.value {
handleOpenNewTab(withBrowserViewController: browserViewController, isPrivate: true)
} else {
browserViewController.askForLocalAuthentication(viewType: .widget) { [weak self] success, _ in
if success {
self?.handleOpenNewTab(withBrowserViewController: browserViewController, isPrivate: true)
if Preferences.Privacy.privateBrowsingLock.value {
browserViewController.askForLocalAuthentication(viewType: .widget) { [weak self] success, _ in
if success {
self?.handleOpenNewTab(withBrowserViewController: browserViewController, isPrivate: true)
}
}
} else {
handleOpenNewTab(withBrowserViewController: browserViewController, isPrivate: true)
}
}
case .scanQRCode:
Expand Down

0 comments on commit 0ea93cf

Please sign in to comment.