chore: cleaner way to implement redirect if role permission denied

This commit is contained in:
Rotimi Best
2024-05-19 18:55:28 +01:00
parent f21bc80dba
commit b6fa251bcd
5 changed files with 51 additions and 26 deletions
-11
View File
@@ -1,11 +0,0 @@
import { goto } from '$app/navigation';
import { globalStore } from '$lib/utils/store/app';
import { get } from 'svelte/store';
export function redirectToLesson(settings, courseId) {
const globalStoreVal = get(globalStore);
if (!settings && globalStoreVal.isOrgSite) {
goto(`${courseId}/lessons?next=true`);
}
}