fix: sort by not using relevance as default type (#5872)
This commit is contained in:
@@ -276,7 +276,9 @@ export function useBrowseSearch(options: UseBrowseSearchOptions): BrowseSearchSt
|
||||
() => options.projectType.value,
|
||||
(newType, oldType) => {
|
||||
debug('projectType changed', { from: oldType, to: newType })
|
||||
currentSortType.value = { display: 'Relevance', name: 'relevance' }
|
||||
effectiveCurrentSortType.value =
|
||||
effectiveSortTypes.value.find((sortType) => sortType.name === 'relevance') ??
|
||||
effectiveSortTypes.value[0]
|
||||
query.value = ''
|
||||
},
|
||||
)
|
||||
|
||||
@@ -59,7 +59,6 @@ const maxResultsOptions = computed<ComboboxOption<number>[]>(() =>
|
||||
:model-value="ctx.effectiveCurrentSortType.value"
|
||||
:options="sortOptions"
|
||||
:class="ctx.variant === 'web' ? '!w-auto flex-grow md:flex-grow-0' : 'max-w-[16rem]'"
|
||||
placeholder="Sort by"
|
||||
@update:model-value="(val: SortType) => (ctx.effectiveCurrentSortType.value = val)"
|
||||
>
|
||||
<template #prefix>
|
||||
|
||||
@@ -115,7 +115,7 @@ export function useSearch(
|
||||
{ display: 'Date updated', name: 'updated' },
|
||||
])
|
||||
|
||||
const currentSortType: Ref<SortType> = ref({ name: 'relevance', display: 'Relevance' })
|
||||
const currentSortType: Ref<SortType> = ref(sortTypes[0])
|
||||
|
||||
const route = useRoute()
|
||||
const currentPage = ref(1)
|
||||
|
||||
Reference in New Issue
Block a user