#if os(macOS) && canImport(RastrilloMacUpdates) import RastrilloMacUpdates #endif import MemoriaKit import RastrilloApple import SwiftUI @main struct MemoriaApp: App { #if os(macOS) && canImport(RastrilloMacUpdates) @State private var updater = NativeUpdater() #endif @StateObject private var connection = NativeConnection(defaultServer: "https://memoria.oficina.works") var body: some Scene { WindowGroup { Group { if let client = connection.client { MemoriaWorkspace(client: client, accounts: connection.showAccounts, signOut: connection.signOut) } else { NativeAccountsView("Oficina Memoria", systemImage: "books.vertical", connection: connection) } }.id(connection.activeAccountID).onOpenURL(perform: connection.handleOpenURL).tint(Color(red: 0.48, green: 0.32, blue: 0.68)) #if os(macOS) .frame(minWidth: 800, minHeight: 580) #endif } #if os(macOS) .defaultSize(width: 1120, height: 780) #if canImport(RastrilloMacUpdates) .commands { NativeUpdateCommands(updater: updater) } #endif #endif } }