From c8b2c051aee214c77d48306aa59f2cc7d02bd296 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Thu, 12 Sep 2024 21:59:53 +0530 Subject: [PATCH] update: logic for self-hosted. --- src/lib/components/backupRestoreBox.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/backupRestoreBox.svelte b/src/lib/components/backupRestoreBox.svelte index 0f33488c5..ce45f0d6a 100644 --- a/src/lib/components/backupRestoreBox.svelte +++ b/src/lib/components/backupRestoreBox.svelte @@ -2,7 +2,7 @@ import { sdk } from '$lib/stores/sdk'; import { type Models, Query } from '@appwrite.io/console'; import { onMount } from 'svelte'; - import { isCloud } from '$lib/system'; + import { isCloud, isSelfHosted } from '$lib/system'; import { organization } from '$lib/stores/organization'; import { BillingPlan } from '$lib/constants'; @@ -18,8 +18,8 @@ backupRestoreItems.archives.length > 0 || backupRestoreItems.restorations.length > 0; const fetchBackupRestores = async (fromRealtime: boolean = false) => { - // fast path: don't fetch if org is on a free plan. - if (isCloud && $organization.billingPlan === BillingPlan.FREE) return; + // fast path: don't fetch if org is on a free plan or is self-hosted. + if (isSelfHosted || (isCloud && $organization.billingPlan === BillingPlan.FREE)) return; try { const query = [Query.orderDesc('')]; @@ -72,8 +72,8 @@ }; onMount(() => { - // fast path: don't subscribe if org is on a free plan. - if (isCloud && $organization.billingPlan === BillingPlan.FREE) return; + // fast path: don't subscribe if org is on a free plan or is self-hosted. + if (isSelfHosted || (isCloud && $organization.billingPlan === BillingPlan.FREE)) return; sdk.forConsole.client.subscribe('console', (response) => { if (