Zustand leaking state

In the app, we have an event page that contains multiple views. Normal users only see the default view, but special permissions give access to the other views, and we control the state of this page with Zustand. This is basically the zustand structure for this.

This has always worked fine, the state is always set to default on first render, so there shouldn't be a problem. However, today we had a user report that they were able to see a page from one of the hidden states. This happen because he had permission in a previous page, then the state "leaked" to this page
image.png
Was this page helpful?