another.im-ios/ConversationsClassic/ConversationsClassicApp.swift
2024-10-22 19:57:50 +02:00

35 lines
1 KiB
Swift

import Combine
import SwiftUI
@main
@MainActor
struct ConversationsClassic: App {
@Environment(\.scenePhase) private var scenePhase
private let clientsStore = ClientsStore.shared
init() {
// There's a bug on iOS 17 where sheet may not load with large title, even if modifiers are set, which causes some tests to fail
// https://stackoverflow.com/questions/77253122/swiftui-navigationstack-title-loads-inline-instead-of-large-when-sheet-is-pres
UINavigationBar.appearance().prefersLargeTitles = true
}
var body: some Scene {
WindowGroup {
RootView()
.environmentObject(clientsStore)
.onChange(of: scenePhase) { phase in
switch phase {
case .active:
clientsStore.reconnectOnActiveState()
case .inactive, .background:
fallthrough
@unknown default:
break
}
}
}
}
}