Ternary and Show have unequal output
In a basic Vite and Solid app, I have
But, "I shouldn't be here" is showing up, while the input (which was originally in place of the "I shouldn't be here") doesn't, as expected. Am I misunderstanding the When component or is it just interacting strangely? It hides the text when I put in a straight false, but not when I use a false reactive signal
26 Replies
Although, later on,
Works just fine
I lied, it kinda doesn't work just fine
you don't need to make the when a function
It's just as broken when it's not a function, for some reason
Always gone when it's not and always there when it is
well
prompting
is false initially so it won't show the text until you set it to true
if it's a function then it'll always resolve to true because there's a value
Should work fineI have a setInterval that ticks the wasm that drives the page object, and I can see in the logs that
prompting
is truehmmm
I don't really see any other reason for this to not work though 🤔
Could you try with a store?
That didn't change anything
Shows no "Continue" and shows "I'm not awaiting confirm"
hmmm and this is after it's set to true?
so weird
is it possible for you to make a repro on stackblitz or the playground?
I'll check
It seems it isn't solid
After some more fiddling I've got
from
A really basic repro works fine
I've come to the conclusion I'm cursed
if you're still using a store, try using reconcile when setting
setPage(reconcile(pageParsed))
It now properly updates the page, but it's saying
awaiting_confirm
is undefined when I try to access it?
Thank you for being patient, by the way. I always end up invoking demons in the strangest waysNo problem, this is an interesting issue
mmm maybe reconcile is failing somehow
well, it is setting the store but I think it might not be merging correctly 🤔 Unless something else is changing
awaiting_confirm
later down the line
btw is this an ecs?It's more of a really poorly made interpreter
Also, the
page
store is only modified in the setInterval
It's interesting that the signal version doesn't work even with
{equals: false}
could you try
Same behaviour, sadly
if you try printing the store via JSON.stringify rather than
{...page}
, what do you get?It shows the same JSON as the input to JSON.parse,
{"image":"daf01c05298d2520430802e452378e8733dfaadc","timer":null,"choices":[],"notifications":[],"prompting":false,"awaiting_comfirm":true}
I am confused
Does the pageJson ever change?
Yes
The engine will return a different JSON string depending on what runs (backgrounds, prompts/choices, etc.)
Does it ever not contain
awaiting_confirm
?All keys are guaranteed to exist, only image and timers may be null
Well, I found the issue
👀
I had a typo in the WASM module that named the field awaiting_comfirm instead of awaiting_confirm
oh okay that's what i figured but I couldn't see it 🤣
my brain glossed over that
Why did we have to make the funny double n letter
Well, thank you for all your help xd
no problem, glad your issue has been resolved and we've learned to pay closer attention to n and m's