chore: conditional rendering of umami

This commit is contained in:
Rotimi Best
2026-03-11 10:37:44 +01:00
parent 996f40bddf
commit d19dddd8cd
10 changed files with 33 additions and 25 deletions
@@ -116,6 +116,7 @@ class AppInitApi extends BaseApi {
return;
}
// This allows you to be on the landing page of an organization site and not be redirected
if (isOrgSite && window.location.pathname === '/') {
return;
}
@@ -45,7 +45,7 @@
let { path, id, isStudent = false }: Props = $props();
const coursesListPath = $derived($globalStore.isOrgSite ? '/lms/mylearning' : `${$currentOrgPath}/courses`);
const coursesListPath = $derived($globalStore.isStudent ? '/lms/mylearning' : `${$currentOrgPath}/courses`);
const contentData = $derived(getCourseContent(courseApi.course));
const sidebar = useSidebar();
const contentCount = $derived.by(() => {
@@ -6,6 +6,7 @@
import { currentOrg } from '$lib/utils/store/org';
import { profile } from '$lib/utils/store/user';
import { coursesApi } from '$features/course/api';
import { resolve } from '$app/paths';
let totalCompleted = $derived(
coursesApi.enrolledCourses.reduce((acc, cur) => {
@@ -38,7 +39,7 @@
? $currentOrg.customization.dashboard.bannerText
: $t('dashboard.lms_dashboard_hero')}
</p>
<Button onclick={() => goto('/lms/mylearning')}>
<Button onclick={() => goto(resolve('/lms/mylearning', {}))}>
{$t('dashboard.continue_learning')}
</Button>
</div>
@@ -29,10 +29,10 @@
function onClick(org: AccountOrg) {
if (org.id === $currentOrg.id) return;
localStorage.setItem('classroomio_org_sitename', org.siteName);
localStorage.setItem('classroomio_org_sitename', org.siteName!);
currentOrg.set(org);
setTheme(org.theme);
setTheme(org.theme!);
window.location.href = $currentOrgPath;
}
</script>