Skip to content

Commit f3275a1

Browse files
committed
Update windows getter
1 parent eabb647 commit f3275a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Core/Sources/SuggestionWidget/FeatureReducers/ChatPanelFeature.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public struct ChatPanelFeature: ReducerProtocol {
8585
@Dependency(\.chatTabBuilderCollection) var chatTabBuilderCollection
8686

8787
@MainActor func toggleFullScreen() {
88-
let window = suggestionWidgetControllerDependency.windows
88+
let window = suggestionWidgetControllerDependency.windowsController?.windows
8989
.chatPanelWindow
9090
window?.toggleFullScreen(nil)
9191
}

Core/Sources/SuggestionWidget/FeatureReducers/PanelFeature.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public struct PanelFeature: ReducerProtocol {
3838
@Dependency(\.suggestionWidgetControllerDependency) var suggestionWidgetControllerDependency
3939
@Dependency(\.xcodeInspector) var xcodeInspector
4040
@Dependency(\.activateThisApp) var activateThisApp
41-
var windows: WidgetWindows { suggestionWidgetControllerDependency.windows }
41+
var windows: WidgetWindows? { suggestionWidgetControllerDependency.windowsController?.windows }
4242

4343
public var body: some ReducerProtocol<State, Action> {
4444
Scope(state: \.suggestionPanelState, action: /Action.suggestionPanel) {
@@ -122,7 +122,9 @@ public struct PanelFeature: ReducerProtocol {
122122

123123
if hasPromptToCode {
124124
activateThisApp()
125-
await windows.sharedPanelWindow.makeKey()
125+
await MainActor.run {
126+
windows?.sharedPanelWindow.makeKey()
127+
}
126128
}
127129
}.animation(.easeInOut(duration: 0.2))
128130

0 commit comments

Comments
 (0)