From 1a304ea425252e39effd5c1c0ef1c502ce5700b6 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 27 Jul 2022 22:56:34 -0500 Subject: [PATCH] Fix collapsible modifier sections not registering persistent --- src/data/common.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/data/common.tsx b/src/data/common.tsx index 29ecd53..c9da34e 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -258,7 +258,7 @@ export interface Section { */ export function createCollapsibleModifierSections( sectionsFunc: () => Section[] -): [JSXFunction, Persistent[]] { +): [JSXFunction, Persistent>] { const sections: Section[] = []; const processed: | { @@ -279,9 +279,7 @@ export function createCollapsibleModifierSections( return sections; } - const collapsed = createLazyProxy(() => - calculateSections().map(() => persistent(false)) - ) as Persistent[]; + const collapsed = persistent>({}); const jsxFunc = jsx(() => { const sections = calculateSections(); @@ -289,10 +287,12 @@ export function createCollapsibleModifierSections( if (unref(processed.visible[i]) === false) return null; const header = (

(collapsed[i].value = !collapsed[i].value)} + onClick={() => (collapsed.value[i] = !collapsed.value[i])} style="cursor: pointer" > - + {s.title} @@ -300,7 +300,7 @@ export function createCollapsibleModifierSections(

); - const modifiers = unref(collapsed[i]) ? null : ( + const modifiers = unref(collapsed.value[i]) ? null : ( <>