@@ -5,7 +5,7 @@ import { debounce } from 'perfect-debounce'
55const pagesWithLocalFilter = new Set ( [ '~username' , 'org' ] )
66
77export function useGlobalSearch ( place : 'header' | 'content' = 'content' ) {
8- const { settings } = useSettings ( )
8+ const instantSearch = useInstantSearch ( )
99 const { searchProvider } = useSearchProvider ( )
1010 const searchProviderValue = computed ( ( ) => {
1111 const p = normalizeSearchParam ( route . query . p )
@@ -29,7 +29,7 @@ export function useGlobalSearch(place: 'header' | 'content' = 'content') {
2929
3030 // This is basically doing instant search as user types
3131 watch ( searchQuery , val => {
32- if ( settings . value . instantSearch ) {
32+ if ( instantSearch . value ) {
3333 committedSearchQuery . value = val
3434 }
3535 } )
@@ -77,7 +77,7 @@ export function useGlobalSearch(place: 'header' | 'content' = 'content') {
7777 // Commit the current query when explicitly submitted (Enter pressed)
7878 committedSearchQuery . value = searchQuery . value
7979 // When instant search is off the debounce queue is empty, so call directly
80- if ( ! settings . value . instantSearch ) {
80+ if ( ! instantSearch . value ) {
8181 updateUrlQueryImpl ( searchQuery . value , searchProvider . value )
8282 } else {
8383 updateUrlQuery . flush ( )
@@ -91,7 +91,7 @@ export function useGlobalSearch(place: 'header' | 'content' = 'content') {
9191
9292 // When instant search is off, skip debounced URL updates
9393 // Only explicitly called flushUpdateUrlQuery commits and navigates
94- if ( ! settings . value . instantSearch ) return
94+ if ( ! instantSearch . value ) return
9595
9696 // Leading debounce implementation as it doesn't work properly out of the box (https://github.com/unjs/perfect-debounce/issues/43)
9797 if ( ! updateUrlQuery . isPending ( ) ) {
0 commit comments