31 lines
972 B
Swift
31 lines
972 B
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct SonarDeskApp: App {
|
|
@StateObject private var appState = AppState()
|
|
@State private var showingLaunch = true
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ZStack {
|
|
RootView()
|
|
.environmentObject(appState)
|
|
.opacity(showingLaunch ? 0 : 1)
|
|
if showingLaunch { LaunchView().transition(.opacity) }
|
|
}
|
|
.frame(minWidth: 1040, minHeight: 680)
|
|
.task {
|
|
if appState.projects.isEmpty && appState.selectedServer != nil { await appState.refresh() }
|
|
try? await Task.sleep(for: .milliseconds(900))
|
|
withAnimation(.easeOut(duration: 0.28)) { showingLaunch = false }
|
|
}
|
|
}
|
|
.windowStyle(.titleBar)
|
|
.commands { SidebarCommands() }
|
|
|
|
Settings {
|
|
SettingsView().environmentObject(appState).frame(width: 620, height: 430)
|
|
}
|
|
}
|
|
}
|