"contains" not working as expected on page load

This is probably not a difficult question, but it’s been driving me up the wall, so I would really appreciate any help.

The goal is

  1. check if notifications are enabled on page load
  2. show that they are enabled if they are enabled and vice versa

The issue has been with reloading the page, where the data connection doesn’t seem to load properly.

Here’s what the UI looks like:


As a quick explanation, the issue here is that even though notifications are enabled, as you can see from the top two text elements which are drawing directly from firestore, the third indicator shows that the custom state (which is initiated on page load) shows that notifications are not enabled. As a result, the UI shows that notifications are not enabled. What is strange is that the exact same criteria is used to set the second element as the third, as shown below:


That state sets the visibility of the notifications enabled and disabled groups. But somehow, reloading the page or pressing the preview button doesn’t reset the state.

Note: I’m pretty sure this is not a firestore plugin issue, because the turn on and turn off buttons act right away, change the values in the database and the top two text elements.

Any ideas why reloading the page is making the contains selection not register true as containing true?

Avoided the issue by just setting the conditions on the visibility to directly get the data from firebase.

This topic was automatically closed after 70 days. New replies are no longer allowed.