From 6aca816ec6a9041319993169fbbc4ae5b838259d Mon Sep 17 00:00:00 2001 From: Pauline Date: Sat, 3 Aug 2024 17:34:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20some=20regressions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx | 2 +- apps/frontend/src/utils/index.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx b/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx index 386e56ad..ac75a494 100644 --- a/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx +++ b/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx @@ -12,7 +12,7 @@ import ClusterScreenshots from './ClusterScreenshots'; import ClusterSettings from './ClusterSettings'; import ClusterGame from './ClusterGame'; import useClusterContext, { ClusterProvider } from '~ui/hooks/useCluster'; -import { supportsMods } from '~utils/helpers'; +import { supportsMods } from '~utils'; import { tryResult } from '~ui/hooks/useCommand'; import { bridge } from '~imports'; import PlayerHead from '~ui/components/game/PlayerHead'; diff --git a/apps/frontend/src/utils/index.ts b/apps/frontend/src/utils/index.ts index 2f4d7b26..27edc56b 100644 --- a/apps/frontend/src/utils/index.ts +++ b/apps/frontend/src/utils/index.ts @@ -1,8 +1,18 @@ -import type { VersionType } from '~bindings'; +import type { Cluster, Loader, VersionType } from '~bindings'; export * from './PausableTimer'; export * from './sorting'; +export function supportsMods(loader?: Cluster | Loader): boolean { + if (loader === undefined) + return false; + + if (typeof loader !== 'string') + loader = loader.meta.loader; + + return loader !== 'vanilla'; +} + export function formatVersionRelease(release: VersionType): string { const mapping: { [key in VersionType]: string } = { old_alpha: 'Alpha',