fix search flashing, reorder filters on mods

This commit is contained in:
Jai A
2024-12-26 22:59:15 -07:00
parent 81ec068747
commit 4d9741c424
3 changed files with 31 additions and 16 deletions

View File

@@ -42,7 +42,11 @@
Install content to server
</h1>
</template>
<NavTabs v-if="!server" :links="selectableProjectTypes" class="hidden md:flex" />
<NavTabs
v-if="!server && !flags.projectTypesPrimaryNav"
:links="selectableProjectTypes"
class="hidden md:flex"
/>
</section>
<aside
:class="{
@@ -338,11 +342,17 @@ const tags = useTags();
const flags = useFeatureFlags();
const auth = await useAuth();
const projectType = computed(() =>
tags.value.projectTypes.find(
const projectType = ref();
function setProjectType() {
projectType.value = tags.value.projectTypes.find(
(x) => x.id === route.path.replaceAll(/^\/|s\/?$/g, ""), // Removes prefix `/` and suffixes `s` and `s/`
),
);
);
}
setProjectType();
router.afterEach(() => {
setProjectType();
});
const projectTypes = computed(() => [projectType.value.id]);
const server = ref();
@@ -516,7 +526,7 @@ const {
const config = useRuntimeConfig();
const base = import.meta.server ? config.apiBaseUrl : config.public.apiBaseUrl;
return `${base}/search${requestParams.value}`;
return `${base}search${requestParams.value}`;
},
{
transform: (hits) => {