@@ -35,6 +35,9 @@ const userMenu = ref<HTMLElement | null>(null);
3535const isVisibleProfile = ref (false );
3636const isVisibleProjects = ref (false );
3737
38+ // TODO: need to check why project is empty on first load
39+ const isProjectLoading = computed (() => ! activeProject .value );
40+
3841onClickOutside (projectMenu , () => {
3942 isVisibleProjects .value = false ;
4043});
@@ -115,15 +118,15 @@ const serverVersion = computed(() =>
115118 : ` @${apiVersion .value } ` ,
116119);
117120
118- const setProject = (project : string ) => {
119- eventsStore .setActiveProject ( project );
121+ const setProject = (projectKey : string ) => {
122+ eventsStore .setActiveProjectKey ( projectKey );
120123
121124 isVisibleProjects .value = false ;
122125};
123126
124- const makeShortTitle = (title : string ) => title .substring (0 , 2 );
127+ const makeShortTitle = (title : string ) => ( title || " " ) .substring (0 , 2 );
125128const generateRadialGradient = (input : string ) =>
126- ` linear-gradient(to right, ${textToColors (input ).join (" , " )}) ` ;
129+ ` linear-gradient(to right, ${textToColors (input || " " ).join (" , " )}) ` ;
127130 </script >
128131
129132<template >
@@ -138,7 +141,7 @@ const generateRadialGradient = (input: string) =>
138141 <IconSvg class =" layout-sidebar__link-icon" name =" logo-short" />
139142 </NuxtLink >
140143
141- <template v-if =" isMultipleProjects " >
144+ <template v-if =" ! isProjectLoading && isMultipleProjects " >
142145 <hr class =" layout-sidebar__sep" />
143146
144147 <div class =" layout-sidebar__projects" >
@@ -163,7 +166,7 @@ const generateRadialGradient = (input: string) =>
163166 <hr class =" layout-sidebar__sep" />
164167 </template >
165168
166- <template v-if =" ! isMultipleProjects " >
169+ <template v-if =" ! isMultipleProjects || isProjectLoading " >
167170 <NuxtLink to =" /" title =" Events" class =" layout-sidebar__link" >
168171 <IconSvg class =" layout-sidebar__link-icon" name =" events" />
169172 </NuxtLink >
0 commit comments