From 4a3ba58f65d12b4f7c7a97b42a5bb3bc0eb5f88b Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Wed, 17 Dec 2025 13:10:57 -0600 Subject: chore: localStorage -> tauri store --- packages/ui/src/context/helper.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packages/ui/src/context') diff --git a/packages/ui/src/context/helper.tsx b/packages/ui/src/context/helper.tsx index 6be88e775..53f987945 100644 --- a/packages/ui/src/context/helper.tsx +++ b/packages/ui/src/context/helper.tsx @@ -1,4 +1,4 @@ -import { createContext, Show, useContext, type ParentProps } from "solid-js" +import { createContext, createMemo, Show, useContext, type ParentProps, type Accessor } from "solid-js" export function createSimpleContext>(input: { name: string @@ -9,9 +9,14 @@ export function createSimpleContext>(input: return { provider: (props: ParentProps) => { const init = input.init(props) - return ( + // Access init.ready inside the memo to make it reactive for getter properties + const isReady = createMemo(() => { // @ts-expect-error - + const ready = init.ready as Accessor | boolean | undefined + return ready === undefined || (typeof ready === "function" ? ready() : ready) + }) + return ( + {props.children} ) -- cgit v1.2.3