Skip to content

Commit d7bcfcd

Browse files
committed
Discard suggestion when the focused editor element is changed
1 parent d609ddb commit d7bcfcd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Core/Sources/SuggestionWidget/FeatureReducers/PanelFeature.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,10 @@ public struct PanelFeature: ReducerProtocol {
9696

9797
case .switchToAnotherEditorAndUpdateContent:
9898
state.content.error = nil
99+
state.content.suggestion = nil
99100
return .run { send in
100101
guard let fileURL = xcodeInspector.realtimeActiveDocumentURL else { return }
101-
if let suggestion = await fetchSuggestionProvider(fileURL: fileURL) {
102-
await send(.presentSuggestionProvider(suggestion, displayContent: false))
103-
}
104-
102+
105103
await send(.sharedPanel(
106104
.promptToCodeGroup(
107105
.updateActivePromptToCode(documentURL: fileURL)

0 commit comments

Comments
 (0)