2026-09-10 09:11:55 +03:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
@main
|
|
|
|
|
struct MusicBridgeApp: App {
|
2026-09-12 21:54:23 +03:00
|
|
|
@StateObject private var store = PreviewSupport.makeStore()
|
2026-09-10 09:11:55 +03:00
|
|
|
@Environment(\.scenePhase) private var phase
|
|
|
|
|
|
|
|
|
|
var body: some Scene {
|
|
|
|
|
WindowGroup {
|
|
|
|
|
ContentView(store: store)
|
2026-09-12 21:54:23 +03:00
|
|
|
.dynamicTypeSize(PreviewSupport.largeText ? DynamicTypeSize.accessibility2...DynamicTypeSize.accessibility2 : DynamicTypeSize.xSmall...DynamicTypeSize.accessibility5)
|
2026-09-12 15:52:31 +03:00
|
|
|
.onOpenURL { store.importInvitation($0.absoluteString) }
|
2026-09-12 21:54:23 +03:00
|
|
|
.task { if !PreviewSupport.enabled { store.setActive(phase == .active) } }
|
|
|
|
|
.onChange(of: phase) { _, value in if !PreviewSupport.enabled { store.setActive(value == .active) } }
|
2026-09-10 09:11:55 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|