Skip to content
Snippets Groups Projects
Commit 71fc464a authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Make refseq path handle baseUrl

parent ffa4f812
No related branches found
No related tags found
No related merge requests found
Pipeline #112512 passed
......@@ -38,6 +38,7 @@
<script setup lang="ts">
// import { useCustomTheme } from '~/composables/useCustomTheme'
import { useDisplay, useTheme } from "vuetify";
import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo";
const runtimeConfig = useRuntimeConfig();
const { navigation } = useContent();
......@@ -47,13 +48,28 @@ const theme = useTheme();
function toggleTheme() {
theme.global.name.value = theme.global.current.value.dark ? "light" : "dark";
}
const refSeqPath = ref("/refseq");
const refinedRefSeqPath = computed(() => {
if (refSeqPath.value?.startsWith("/") && !refSeqPath.value.startsWith("//")) {
const _base = withLeadingSlash(
withTrailingSlash(useRuntimeConfig().app.baseURL)
);
if (_base !== "/" && !refSeqPath.value.startsWith(_base)) {
return joinURL(_base, refSeqPath.value);
}
}
return refSeqPath;
});
const sections = ref([
{
id: "webservice",
label: "webservice",
href: runtimeConfig.public.defenseFinderWebservice,
},
{ id: "refseq", label: "REFSEQ", href: "/refseq" },
{ id: "refseq", label: "REFSEQ", href: refinedRefSeqPath },
]);
const drawer = ref(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment