diff --git a/composables/useModules.ts b/composables/useModules.ts index b2225da7e..c138dabdd 100644 --- a/composables/useModules.ts +++ b/composables/useModules.ts @@ -246,8 +246,11 @@ export const useModules = () => { filteredModules = filteredModules.reverse() } - // sponsored & official modules in first place - return filteredModules.sort(isSponsorOrOfficial) + // sponsored & official modules in first place if no sort or order by + if (!route.query.sortBy && !route.query.orderBy) { + return filteredModules.sort(isSponsorOrOfficial) + } + return filteredModules }) return { diff --git a/pages/modules/index.vue b/pages/modules/index.vue index ebce269c5..be7394a19 100644 --- a/pages/modules/index.vue +++ b/pages/modules/index.vue @@ -7,7 +7,7 @@ const inputRef = ref() const route = useRoute() const { replaceRoute } = useFilters('modules') -const { fetchList, filteredModules, q, categories, stats } = useModules() +const { fetchList, filteredModules, q, categories, stats, selectedOrder, sorts, selectedSort } = useModules() const { data: page } = await useAsyncData(route.path, () => queryContent(route.path).findOne()) @@ -64,7 +64,7 @@ const { copy } = useCopyToClipboard() name="q" icon="i-ph-magnifying-glass" placeholder="Search..." - class="w-full mb-4" + class="w-full mb-2" size="md" autocomplete="off" :ui="{ icon: { trailing: { pointer: '' } } }" @@ -85,12 +85,28 @@ const { copy } = useCopyToClipboard() + + + + - -
+ +
+ + + +