Skip to content

Commit

Permalink
Remove explicit autofill popover dismissal code
Browse files Browse the repository at this point in the history
  • Loading branch information
aataraxiaa committed Mar 6, 2024
1 parent cd5a498 commit f7b31aa
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions DuckDuckGo/SecureVault/View/PasswordManagementPopover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import SwiftUI

final class PasswordManagementPopover: NSPopover {

private var cancellables = Set<AnyCancellable>()

override init() {
super.init()

Expand Down Expand Up @@ -61,23 +59,6 @@ final class PasswordManagementPopover: NSPopover {

extension PasswordManagementPopover: NSPopoverDelegate {

func popoverDidShow(_ notification: Notification) {
NotificationCenter.default.publisher(for: NSWindow.didResignMainNotification)
.receive(on: DispatchQueue.main)
.sink { [weak self] _ in
guard let self = self, self.isShown else { return }

if !DeviceAuthenticator.shared.isAuthenticating {
self.close()
}
}
.store(in: &cancellables)
}

func popoverShouldClose(_ popover: NSPopover) -> Bool {
return !DeviceAuthenticator.shared.isAuthenticating
}

func popoverDidClose(_ notification: Notification) {
if let window = viewController.view.window {
for sheet in window.sheets {
Expand Down

0 comments on commit f7b31aa

Please sign in to comment.