Added a lot of functionality. Bugfixes and changes
This commit is contained in:
@@ -15,6 +15,11 @@ struct oAIApp: App {
|
||||
@State private var chatViewModel = ChatViewModel()
|
||||
@State private var showAbout = false
|
||||
|
||||
init() {
|
||||
// Start email handler on app launch
|
||||
EmailHandlerService.shared.start()
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
@@ -23,6 +28,14 @@ struct oAIApp: App {
|
||||
.sheet(isPresented: $showAbout) {
|
||||
AboutView()
|
||||
}
|
||||
#if os(macOS)
|
||||
.onReceive(NotificationCenter.default.publisher(for: NSApplication.willTerminateNotification)) { _ in
|
||||
// Trigger auto-save on app quit
|
||||
Task {
|
||||
await chatViewModel.onAppWillTerminate()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if os(macOS)
|
||||
.windowStyle(.hiddenTitleBar)
|
||||
|
||||
Reference in New Issue
Block a user