mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-11 04:34:55 -06:00
[PM-22347] Improved Open generator intent error alert behavior (#1653)
This commit is contained in:
parent
9e54e05811
commit
e0aa268b98
@ -2,13 +2,13 @@ import AppIntents
|
||||
import BitwardenShared
|
||||
|
||||
/// App intent that opens the generator view.
|
||||
@available(iOS 16.0, *)
|
||||
struct OpenGeneratorIntent: AppIntent {
|
||||
@available(iOS 16.4, *)
|
||||
struct OpenGeneratorIntent: ForegroundContinuableIntent {
|
||||
static var title: LocalizedStringResource = "OpenGenerator"
|
||||
|
||||
static var description = IntentDescription("OpenGenerator")
|
||||
|
||||
static var openAppWhenRun: Bool = true
|
||||
static var openAppWhenRun: Bool = false
|
||||
|
||||
@MainActor
|
||||
func perform() async throws -> some IntentResult {
|
||||
@ -18,11 +18,13 @@ struct OpenGeneratorIntent: AppIntent {
|
||||
let appIntentMediator = services.getAppIntentMediator()
|
||||
|
||||
guard try await appIntentMediator.canRunAppIntents() else {
|
||||
return .result()
|
||||
throw BitwardenShared.AppIntentError.notAllowed
|
||||
}
|
||||
|
||||
await appIntentMediator.openGenerator()
|
||||
|
||||
try await requestToContinueInForeground()
|
||||
|
||||
return .result()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import AppIntents
|
||||
|
||||
/// The app shortcuts provider.
|
||||
@available(iOS 16.0, *)
|
||||
@available(iOS 16.4, *)
|
||||
struct ShortcutsProvider: AppShortcutsProvider {
|
||||
/// The app shortcuts.
|
||||
static var appShortcuts: [AppShortcut] {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user