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;
|
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>
|
</script>
|
||||||
|
|
||||||
<UnsavedChanges bind:hasUnsavedChanges />
|
<UnsavedChanges bind:hasUnsavedChanges />
|
||||||
@@ -352,7 +352,7 @@
|
|||||||
<IconButton onclick={generateNewCourseLink}>
|
<IconButton onclick={generateNewCourseLink}>
|
||||||
<RotateCcwIcon size={16} />
|
<RotateCcwIcon size={16} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton onclick={() => goto(courseLink)}>
|
<IconButton href={courseLink} target="_blank">
|
||||||
<ArrowUpRightIcon size={16} />
|
<ArrowUpRightIcon size={16} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const currentOrgDomain = 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;
|
const browserOrigin = dev && browser && window.location.origin;
|
||||||
|
|
||||||
// Get the root domain from window.location
|
// Get the root domain from window.location
|
||||||
|
|||||||
Reference in New Issue
Block a user