fix: update course link behavior to open in a new tab and adjust course link fallback for self-hosted instances
This commit is contained in:
@@ -270,7 +270,7 @@
|
||||
return selected;
|
||||
});
|
||||
|
||||
let courseLink = $derived(courseApi.course?.slug ? `${$currentOrgDomain}/course/${courseApi.course.slug}` : '');
|
||||
let courseLink = $derived(courseApi.course?.slug ? `${$currentOrgDomain}/course/${courseApi.course.slug}` : '#');
|
||||
</script>
|
||||
|
||||
<UnsavedChanges bind:hasUnsavedChanges />
|
||||
@@ -352,7 +352,7 @@
|
||||
<IconButton onclick={generateNewCourseLink}>
|
||||
<RotateCcwIcon size={16} />
|
||||
</IconButton>
|
||||
<IconButton onclick={() => goto(courseLink)}>
|
||||
<IconButton href={courseLink} target="_blank">
|
||||
<ArrowUpRightIcon size={16} />
|
||||
</IconButton>
|
||||
</div>
|
||||
|
||||
@@ -60,6 +60,8 @@ export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
|
||||
);
|
||||
|
||||
export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
|
||||
if (PUBLIC_IS_SELFHOSTED === 'true') return window.location.origin;
|
||||
|
||||
const browserOrigin = dev && browser && window.location.origin;
|
||||
|
||||
// Get the root domain from window.location
|
||||
|
||||
Reference in New Issue
Block a user