Local storage value changing on its own

Hello,

I'm setting a local storage variable when the row in a table is selected:

Then - I'm switching pages (apps), and using this local storage variable to pull some records, and populate my table.

The query code is:

 bla bla bla etc....matrix_data.updated_by from matrix_data
WHERE matrix_data.report_record_id = {{localStorage.values.report_record_id}}

BUt when the page (app) loads - it shows my data momentarily. Then it goes.
When I check the debugger - it shows that the localStorage variable is somehow being changed. But as far as I am ware - there are no other events or components changing this - so I'm not sure why.....

You can see it happening below.

Does anyone have any suggestions on how I can figure this out?

thanks
Neil

locatStorage

Hi @maillme

I think during the load an initial select row event is fired, setting the localStorage value with what is able to find in that moment.
Any chances that during that time the localStorage value is overwritten by an object with that prop missing?

Hope this help.

Hi Fabio,
thanks for the reply.

When I eopn the app 'empty' - there is no localStorage.

Of course - when I then provide data from the table which is feeding the query, then it does load.... initially it is correct and then indeed, something, somewhere seems to be changing this localStorage - bit nothing else is linked to it.

Unfortunately, because the debug window resets each app - I am not quick enough to see when the value is changing, but it is indeed seemingly when the new app loads.

And then

I have a solution - just create a new localStorage var:
Problem solved. Sometimes treating the symptom is better :slight_smile:

1 Like