Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
33.56k stars 1.87k forks source link

fix(Permissions Error): Permissions error was persisting after switching organizations #7544

Closed gatzjames closed 1 week ago

gatzjames commented 2 weeks ago

Highlights:

jackkav commented 2 weeks ago

Why does this work?

gatzjames commented 2 weeks ago

Why does this work?

We rely on the result of the fetcher data.error to be there and then show the upgrade modal. When we create a new project in another org the fetcher runs for the new data but our use effect sees the previous state and shows the needs to upgrade modal. This is a quirk of having to rely on the fetcher state and subscribing to that with a useEffect.