diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte
index d28cce103..2791d7b73 100644
--- a/src/lib/components/support.svelte
+++ b/src/lib/components/support.svelte
@@ -5,17 +5,29 @@
import { isSupportOnline, showSupportModal } from '$routes/(console)/wizard/support/store';
import { trackEvent } from '$lib/actions/analytics';
import { localeShortTimezoneName, utcHourToLocaleHour } from '$lib/helpers/date';
- import { upgradeURL } from '$lib/stores/billing';
+ import { plansInfo } from '$lib/stores/billing';
import { Card } from '$lib/components/index';
import { app } from '$lib/stores/app';
- import { currentPlan } from '$lib/stores/organization';
+ import { currentPlan, organizationList } from '$lib/stores/organization';
import { isCloud } from '$lib/system';
+ import { base } from '$app/paths';
export let show = false;
export let showHeader = true;
- $: hasPremiumSupport = $currentPlan?.premiumSupport ?? false;
+ $: hasPremiumSupport = $currentPlan?.premiumSupport ?? areAllOrganizationsPaid ?? false;
+
+ $: areAllOrganizationsPaid = $organizationList.teams.every(
+ (team) => $plansInfo.get(team['billingPlan'])?.premiumSupport
+ );
+
+ // there can only be one free organization
+ $: freeOrganization = $organizationList.teams.find(
+ (team) => !$plansInfo.get(team['billingPlan'])?.premiumSupport
+ );
+
+ $: upgradeURL = `${base}/organization-${freeOrganization.$id}/change-plan`;
$: supportTimings = `${utcHourToLocaleHour('16:00')} - ${utcHourToLocaleHour('00:00')} ${localeShortTimezoneName()}`;
@@ -54,7 +66,7 @@
}
];
- const showCloudSupport = (index) => {
+ const showCloudSupport = (index: number) => {
return (index === 0 && isCloud) || index > 0;
};
@@ -82,7 +94,7 @@
{#if !hasPremiumSupport}