From 9d71ccee39a2efbf627aee5a55d0da5b9afe0fc1 Mon Sep 17 00:00:00 2001 From: Ally Founder Date: Mon, 10 Aug 2026 22:09:31 -0400 Subject: [PATCH] FakeProfileThemesAndEffects: fix Icon.Sizes crash confirmed live in Effects picker --- .../src/ui/components/Icon.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/fake-profile-themes-and-effects/src/ui/components/Icon.ts b/plugins/fake-profile-themes-and-effects/src/ui/components/Icon.ts index 39bc13e..2c2828d 100644 --- a/plugins/fake-profile-themes-and-effects/src/ui/components/Icon.ts +++ b/plugins/fake-profile-themes-and-effects/src/ui/components/Icon.ts @@ -10,6 +10,18 @@ export interface IconProps extends Pick null` fallback, which has no .Sizes property at all for callers +// like `Icon.Sizes.LARGE` to read. Falling back to a real, static SizeKey map instead of an +// empty function means Icon always has a valid .Sizes even before the real module resolves. +const FALLBACK_SIZES: Record = { + EXTRA_SMALL_10: "extra_small_10", EXTRA_SMALL: "extra_small", SMALL: "small", SMALL_20: "small_20", + MEDIUM: "medium", LARGE: "large", CUSTOM: "custom", REFRESH_SMALL_16: "refresh_small_16", SMALL_14: "small_14", +}; + +const resolvedIcon = (findByProps("IconSizes") as Record | undefined)?.default; + export const Icon: ComponentType & { Sizes: Record; -} = (findByProps("IconSizes") as Record | undefined)?.default ?? (() => null); +} = resolvedIcon ?? Object.assign(() => null, { Sizes: FALLBACK_SIZES });