From 9021135dec11140e4fbaf5a63c0cacefd45d0501 Mon Sep 17 00:00:00 2001 From: Ally Founder Date: Mon, 10 Aug 2026 22:20:01 -0400 Subject: [PATCH] FakeProfileThemesAndEffects: effects picker rendered blank - ProfileEffectRecord needs raw config, not the {id,skuId,config} wrapper --- .../src/patches/patchUseProfileEffectSections.ts | 2 +- .../src/ui/actionSheets/EffectPickerActionSheet.tsx | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/fake-profile-themes-and-effects/src/patches/patchUseProfileEffectSections.ts b/plugins/fake-profile-themes-and-effects/src/patches/patchUseProfileEffectSections.ts index d468f8c..8b3d86a 100644 --- a/plugins/fake-profile-themes-and-effects/src/patches/patchUseProfileEffectSections.ts +++ b/plugins/fake-profile-themes-and-effects/src/patches/patchUseProfileEffectSections.ts @@ -21,7 +21,7 @@ export const patchUseProfileEffectSections = () => useSectionModules.map( origSections.splice(1); origSections[0]!.items.splice(1); profileEffectStore.profileEffects.forEach(effect => { - origSections[0]!.items.push(new ProfileEffectRecord(effect)); + origSections[0]!.items.push(new ProfileEffectRecord(effect.config)); }); prevSections = origSections; } else if (prevSections) { diff --git a/plugins/fake-profile-themes-and-effects/src/ui/actionSheets/EffectPickerActionSheet.tsx b/plugins/fake-profile-themes-and-effects/src/ui/actionSheets/EffectPickerActionSheet.tsx index 0225d29..2d5e115 100644 --- a/plugins/fake-profile-themes-and-effects/src/ui/actionSheets/EffectPickerActionSheet.tsx +++ b/plugins/fake-profile-themes-and-effects/src/ui/actionSheets/EffectPickerActionSheet.tsx @@ -39,7 +39,11 @@ function PatchedEffectPickerActionSheet(props: EffectPickerActionSheetProps) { const themeContext = useThemeContext(); - const effectRecords = useMemo(() => effects.map(effect => ({ items: new ProfileEffectRecord(effect) })), [effects]); + // ProfileEffectRecord's fields mirror the raw shop config (skuId, title, thumbnailPreviewSrc, + // effects, ...) - confirmed live that constructing it from our {id, skuId, config} wrapper + // instead of effect.config leaves everything but skuId/type undefined, which is why the picker + // used to open with a fully empty effect list. + const effectRecords = useMemo(() => effects.map(effect => ({ items: new ProfileEffectRecord(effect.config) })), [effects]); let isLegacyEffectPicker = false; const effectPickerInner: RN.Element | null = findElementInTree(tree, element => { @@ -93,7 +97,7 @@ function PatchedEffectPickerActionSheet(props: EffectPickerActionSheetProps) { } else { if (effectPickerInner.props.selectedProfileEffect === undefined) effectPickerInner.props.setSelectedProfileEffect(currentEffectId - ? new ProfileEffectRecord({ id: currentEffectId } as any) + ? new ProfileEffectRecord({ skuId: currentEffectId } as any) : null); effectPickerInner.props.purchases = effectRecords; } @@ -101,7 +105,9 @@ function PatchedEffectPickerActionSheet(props: EffectPickerActionSheetProps) { setPreviewUserId(user.id); applyButton.props.onPress = () => { setPreviewUserId(undefined); - onSelect(effects.find(effect => effect.id === effectPickerInner.props.selectedProfileEffect?.id)?.config ?? null); + // selectedProfileEffect is a ProfileEffectRecord - confirmed live it has no .id field, only + // .skuId, so comparing against effect.id here always missed and onSelect got null every time. + onSelect(effects.find(effect => effect.skuId === effectPickerInner.props.selectedProfileEffect?.skuId)?.config ?? null); }; return (lastGoodTree = tree) as ReactElement;