-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevLogApp.swift
More file actions
60 lines (56 loc) · 2.07 KB
/
Copy pathDevLogApp.swift
File metadata and controls
60 lines (56 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// DevLogApp.swift
// DevLog
//
// Created by opfic on 5/2/25.
//
import SwiftUI
import DevLogCore
import DevLogData
import DevLogDomain
import DevLogPresentation
import DevLogWidget
@main
struct DevLogApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
@Environment(\.diContainer) var container: DIContainer
@Environment(\.scenePhase) var scenePhase
@State private var windowEvent = TodoEditorWindowEvent()
init() {
AppAssembler().assemble(AppDIContainer.shared)
}
var body: some Scene {
WindowGroup {
RootView(
sessionUseCase: container.resolve(ObserveAuthSessionUseCase.self),
networkConnectivityUseCase: container.resolve(ObserveNetworkConnectivityUseCase.self),
systemThemeUseCase: container.resolve(ObserveSystemThemeUseCase.self),
trackAnalyticsEventUseCase: container.resolve(TrackAnalyticsEventUseCase.self),
signInUseCase: container.resolve(SignInUseCase.self),
widgetURLTab: { MainTab(widgetURL: $0) },
windowEvent: windowEvent,
pushNotificationTodoIdPublisher: PushNotificationRoute.shared.observe(),
clearPushNotificationRoute: { PushNotificationRoute.shared.clear() }
)
.autocorrectionDisabled()
.onChange(of: scenePhase) { _, phase in
guard phase == .background else { return }
container.resolve(WidgetSyncEventBus.self).publish(.syncRequested)
}
}
WindowGroup(id: TodoEditorWindowValue.sceneId, for: TodoEditorWindowValue.self) { value in
if let value = value.wrappedValue {
TodoEditorWindowView(
value: value,
windowEvent: windowEvent
)
.autocorrectionDisabled()
} else {
ContentUnavailableView(
String(localized: "todo_edit"),
systemImage: "square.and.pencil"
)
}
}
}
}