- {#each viewModeComponents as Component}
+ {#each viewModeComponents as Component, index (index)}
{/each}
@@ -437,9 +436,11 @@
variant="page"
class="text-center"
>
-
+ {#if !$globalStore.isStudent}
+
+ {/if}
{/if}
diff --git a/apps/dashboard/src/lib/utils/store/app.ts b/apps/dashboard/src/lib/utils/store/app.ts
index 49d6bc23..3045c5f2 100644
--- a/apps/dashboard/src/lib/utils/store/app.ts
+++ b/apps/dashboard/src/lib/utils/store/app.ts
@@ -1,4 +1,5 @@
import { derived, writable } from 'svelte/store';
+
import { PUBLIC_IS_SELFHOSTED } from '$env/static/public';
import { currentOrgPath } from './org';
@@ -17,6 +18,12 @@ export const globalStore = writable<{
/**
* Single source of truth: is this a student experience?
* Cloud: orgSite is always student. Self-hosted: check role.
+ *
+ * why are we not using isOrgStudent from org store?
+ * because this is derived from the currentOrg which returns null if no org OR boolean if org is present. Once org data is set, we then update globalStore.isStudent to the same value.
+ *
+ * why are we not using only globalStore.isStudent for this?
+ * because in the cloud instance, when a teacher logs into the lms aka org site, they need to be treated as a student so they see what the student sees.
*/
export const isStudentExperience = derived(globalStore, ($gs) => {
const isCloud = PUBLIC_IS_SELFHOSTED !== 'true';
diff --git a/apps/dashboard/src/routes/course/[slug]/enroll/+page.svelte b/apps/dashboard/src/routes/course/[slug]/enroll/+page.svelte
index 83da4a48..0088856c 100644
--- a/apps/dashboard/src/routes/course/[slug]/enroll/+page.svelte
+++ b/apps/dashboard/src/routes/course/[slug]/enroll/+page.svelte
@@ -84,7 +84,8 @@
already_joined: result.data.alreadyJoined
});
- goto(result.data.redirectTo || '/lms');
+ // need to force page reload to avoid cache issues
+ window.location.href = result.data.redirectTo || '/lms';
} finally {
loading = false;
}
diff --git a/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte b/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
index 098f87b1..bb11a01e 100644
--- a/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
@@ -4,7 +4,7 @@
import { t } from '$lib/utils/functions/translations';
-
+