Skip to content

Commit 7fc5ba1

Browse files
feat: clear rewrite on clear search
1 parent e7e1049 commit 7fc5ba1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/webview/SearchSidebar/SearchWidgetContainer/SearchWidget.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ function ReplaceBar() {
5151
const { searching, groupedByFileSearchResult } = useSearchResult()
5252
const disabled =
5353
!rewrite || searching || groupedByFileSearchResult.length === 0
54+
// sadly unport does not support unsub
55+
useEffectOnce(() => {
56+
childPort.onMessage('clearSearchResults', () => {
57+
setRewrite('')
58+
})
59+
})
5460
return (
5561
<div {...stylex.props(styles.replaceToolbar)}>
5662
<SearchInput

0 commit comments

Comments
 (0)