feat: add custom domain to domain button

This commit is contained in:
Rotimi Best
2024-09-05 15:19:45 +01:00
parent 2d5f0ba6ad
commit 3d94926343
+7 -3
View File
@@ -35,16 +35,20 @@ export const isOrgAdmin = derived(currentOrg, ($currentOrg) => $currentOrg.role_
export const currentOrgPlan = derived(currentOrg, ($currentOrg) =>
$currentOrg.organization_plan.find((p) => p.is_active)
);
export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
$currentOrg.siteName ? `/org/${$currentOrg.siteName}` : ''
);
export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
const browserOrigin = dev && browser && window.location.origin;
return browserOrigin
? browserOrigin
: $currentOrg.siteName
? `https://${$currentOrg.siteName}.classroomio.com`
: '';
: $currentOrg.customDomain && $currentOrg.isCustomDomainVerified
? `https://${$currentOrg.customDomain}`
: $currentOrg.siteName
? `https://${$currentOrg.siteName}.classroomio.com`
: '';
});
// Utility org store