feat: move initialization of navbar state variable to the initializer parameter of its definition
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-08-11 01:47:04 +02:00
parent 254f7c25e3
commit 5c38f9f9fc
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -55,7 +55,18 @@ definePageMeta({
}); });
const loading = useState("loading", () => false); const loading = useState("loading", () => false);
const navbar = useState<INavbar>("navbar") const navbar = useState<INavbar>("navbar", () => {
return {
clientItems: [
{
title: "Source",
icon: "lucide:code-xml",
callback: () => { open("https://git.gorb.app/gorb/frontend") }
}
],
channelItems: [] // set by the channel
}
})
const createButtonContainer = ref<HTMLButtonElement>(); const createButtonContainer = ref<HTMLButtonElement>();
@ -150,23 +161,6 @@ const options = [
const guilds = await api.fetchMyGuilds(); const guilds = await api.fetchMyGuilds();
onMounted(() => {
if (!navbar.value) {
const sourceLinkItem: NavbarItem = {
title: "Source",
icon: "lucide:code-xml",
callback: () => { open("https://git.gorb.app/gorb/frontend") }
}
navbar.value = {
clientItems: [
sourceLinkItem
],
channelItems: [] // set by the channel
}
}
})
function createDropdown() { function createDropdown() {
const dropdown = h(GuildDropdown, { options }); const dropdown = h(GuildDropdown, { options });
const div = document.createElement("div"); const div = document.createElement("div");