Wappler Version : 5.4.2
Operating System : Windows 11
Server Model: capacitor
Database Type: N/A
Hosting Type: web
Expected behavior
Local storage value should be read in actions
Actual behavior
The value in localstorage is not being returned.
How to reproduce
In this video, you’ll see I’m setting “inner text” of two elements to the value in local storage and cookie storage. The ‘true’ value in cookie storage is returned successfully, but the value in local storage is not. The ‘login activity’ text should be replaced by the value in local storage.
The value in “darkmode” was set via an mouse click event that I setup on a toggle. That’s how the value was originally set in the darkmode key.
What’s weird is I made some minor changes to the name of the localstorage and switched from a boolean to text field property and now the click event created a different key with dmxState added to the beginning.
The end goal of all of this is to set a class on an element. I am able to see the value using dmx-text, but using dmx-class:active="(brightyard.data.darkmode == 1)" does not set the class to active.
Ok, so it looks like trying to set a class on an <a> tag might be the problem.
In this code I am attempting to set the active class on the <li> and <a> tags.
What I had to do was manually add dmxState to the key in the Set Storage step. I don’t understand why one way auto adds it and the other does not if it’s needed for Wappler to function correctly.