Closed allanlasser closed 3 weeks ago
I think some flavor of invalidate
will handle this. Either we add a tag to the root layout -- see https://github.com/MuckRock/documentcloud-frontend/issues/602#issuecomment-2229502329 -- or we just do invalidateAll
, which might be effectively the same thing.
This is going to cause a ton of data to reload, but I don't think there's a way around that. Anything that depends on a user's org for access becomes invalid, and that's just a lot of stuff.
When the user changes their current organization from the org menu (#602), the application will need to revalidate a bunch of data. This includes the manager sidebar ("Your Organization's Documents" filter), the permissions on which documents are visible, and the status of a user's premium account permissions and balances.
Since the organization menu will be present in the global navigation, the org can be switched from any route.
This may be as simple as calling
invalidate
on the current/affected route after switching.