Skip to content

Commit 552240b

Browse files
committed
fix: correct search data transferring client to server
1 parent e461e4c commit 552240b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/composables/useSettings.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,18 @@ export function useAccentColor() {
115115
* Composable for managing the search provider setting.
116116
*/
117117
export function useSearchProvider() {
118+
const cookie = useCookie('search-provider', {
119+
secure: true,
120+
sameSite: 'strict',
121+
maxAge: 60 * 60 * 24 * 30,
122+
path: '/',
123+
})
118124
const { settings } = useSettings()
119125

120126
const searchProvider = computed({
121-
get: () => settings.value.searchProvider,
127+
get: () => (cookie.value === 'npm' ? 'npm' : settings.value.searchProvider),
122128
set: (value: SearchProvider) => {
129+
cookie.value = value
123130
settings.value.searchProvider = value
124131
},
125132
})

0 commit comments

Comments
 (0)