@@ -102,6 +102,13 @@ export const SearchResultsPage = ({
102102 ] )
103103 } , [ searchQuery , setSearchHistory ] ) ;
104104
105+ // Look for any files that are not on the default branch.
106+ const isBranchFilteringEnabled = useMemo ( ( ) => {
107+ return files . some ( ( file ) => {
108+ return file . branches ?. some ( ( branch ) => branch !== 'HEAD' ) ?? false ;
109+ } ) ;
110+ } , [ files ] ) ;
111+
105112 useEffect ( ( ) => {
106113 if ( isStreaming || ! stats ) {
107114 return ;
@@ -138,6 +145,7 @@ export const SearchResultsPage = ({
138145 flushReason : stats . flushReason ,
139146 fileLanguages,
140147 isSearchExhaustive : isExhaustive ,
148+ isBranchFilteringEnabled,
141149 } ) ;
142150 } , [
143151 captureEvent ,
@@ -147,6 +155,7 @@ export const SearchResultsPage = ({
147155 stats ,
148156 timeToSearchCompletionMs ,
149157 timeToFirstSearchResultMs ,
158+ isBranchFilteringEnabled ,
150159 ] ) ;
151160
152161 const onLoadMoreResults = useCallback ( ( ) => {
@@ -157,13 +166,7 @@ export const SearchResultsPage = ({
157166 router . push ( url ) ;
158167 } , [ maxMatchCount , router , searchQuery , domain ] ) ;
159168
160- // Look for any files that are not on the default branch.
161- const isBranchFilteringEnabled = useMemo ( ( ) => {
162- return files . some ( ( file ) => {
163- return file . branches ?. some ( ( branch ) => branch !== 'HEAD' ) ?? false ;
164- } ) ;
165- } , [ files ] ) ;
166-
169+
167170 return (
168171 < div className = "flex flex-col h-screen overflow-clip" >
169172 { /* TopBar */ }
0 commit comments