[refactor] simplify redundant check in cloud badge extension (#6106)

Simplifies code with tautological condition. The extension is only
loaded when `isCloud` is true due to
38f188759d/src/extensions/core/index.ts (L27-L29)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6106-refactor-simplify-redundant-check-in-cloud-badge-extension-28f6d73d365081d69903f5a985fdc8be)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2025-10-18 01:25:59 -07:00
committed by GitHub
parent 10748bdac9
commit 3fc8b49038
2 changed files with 7 additions and 11 deletions

View File

@@ -1,16 +1,12 @@
import { t } from '@/i18n'
import { isCloud } from '@/platform/distribution/types'
import { useExtensionService } from '@/services/extensionService'
useExtensionService().registerExtension({
name: 'Comfy.CloudBadge',
// Only show badge when running in cloud environment
topbarBadges: isCloud
? [
{
label: t('g.beta'),
text: 'Comfy Cloud'
}
]
: undefined
topbarBadges: [
{
label: t('g.beta'),
text: 'Comfy Cloud'
}
]
})

View File

@@ -17,4 +17,4 @@ const DISTRIBUTION: Distribution = __DISTRIBUTION__
/** Distribution type checks */
export const isDesktop = DISTRIBUTION === 'desktop' || isElectron() // TODO: replace with build var
export const isCloud = DISTRIBUTION === 'cloud'
// export const isLocalhost = !isDesktop && !isCloud
// export const isLocalhost = DISTRIBUTION === 'localhost' || (!isDesktop && !isCloud)