mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-11-19 03:55:59 +01:00
Add settings for batch auth handling. (#870)
This commit is contained in:
1 parent
164aacc94e
commit
56c2f841ed
10 files changed
+191
-20
No files matched your search
@@ -3,11 +3,14 @@ import SecretKit
|
||||
import SecretAgentKit
|
||||
import SmartCardSecretKit
|
||||
import Common
|
||||
import ApplicationServices
|
||||
import SettingsKit
|
||||
|
||||
struct PendingRequestsView: View {
|
||||
|
||||
private let authenticationHandler: any AuthenticationHandlerProtocol
|
||||
@Environment(\.dismissWindow) var dismiss
|
||||
@Environment(\.settingsStore) var settingsStore
|
||||
|
||||
init(authenticationHandler: some AuthenticationHandlerProtocol) {
|
||||
self.authenticationHandler = authenticationHandler
|
||||
@@ -92,6 +95,19 @@ struct PendingRequestsView: View {
|
||||
}
|
||||
}
|
||||
.safeAreaPadding(20)
|
||||
.onAppear {
|
||||
guard settingsStore.showDockItemWithPendingRequestsScreen else { return }
|
||||
var process = ProcessSerialNumber(highLongOfPSN: 0, lowLongOfPSN: UInt32(kCurrentProcess))
|
||||
unsafe TransformProcessType(&process, ProcessApplicationTransformState(kProcessTransformToForegroundApplication))
|
||||
NSApplication.shared.dockTile.showsApplicationBadge = true
|
||||
NSApplication.shared.dockTile.display()
|
||||
NSApplication.shared.requestUserAttention(.criticalRequest)
|
||||
}
|
||||
.onDisappear {
|
||||
guard settingsStore.showDockItemWithPendingRequestsScreen else { return }
|
||||
var process = ProcessSerialNumber(highLongOfPSN: 0, lowLongOfPSN: UInt32(kCurrentProcess))
|
||||
unsafe TransformProcessType(&process, ProcessApplicationTransformState(kProcessTransformToBackgroundApplication))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user