Download this file
| 1 | #if os(macOS) && canImport(RastrilloMacUpdates) |
| 2 | import RastrilloMacUpdates |
| 3 | #endif |
| 4 | import MemoriaKit |
| 5 | import RastrilloApple |
| 6 | import SwiftUI |
| 7 | |
| 8 | @main struct MemoriaApp: App { |
| 9 | #if os(macOS) && canImport(RastrilloMacUpdates) |
| 10 | @State private var updater = NativeUpdater() |
| 11 | #endif |
| 12 | @StateObject private var connection = NativeConnection(defaultServer: "https://memoria.oficina.works") |
| 13 | var body: some Scene { |
| 14 | WindowGroup { |
| 15 | Group { |
| 16 | if let client = connection.client { MemoriaWorkspace(client: client, accounts: connection.showAccounts, signOut: connection.signOut) } |
| 17 | else { NativeAccountsView("Oficina Memoria", systemImage: "books.vertical", connection: connection) } |
| 18 | }.id(connection.activeAccountID).onOpenURL(perform: connection.handleOpenURL).tint(Color(red: 0.48, green: 0.32, blue: 0.68)) |
| 19 | #if os(macOS) |
| 20 | .frame(minWidth: 800, minHeight: 580) |
| 21 | #endif |
| 22 | } |
| 23 | #if os(macOS) |
| 24 | .defaultSize(width: 1120, height: 780) |
| 25 | #if canImport(RastrilloMacUpdates) |
| 26 | .commands { NativeUpdateCommands(updater: updater) } |
| 27 | #endif |
| 28 | #endif |
| 29 | } |
| 30 | } |
| 31 | |