Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Fix switching tenants not working #1172

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

mrkaye97
Copy link
Contributor

@mrkaye97 mrkaye97 commented Jan 9, 2025

Switching tenants right now in production doesn't work right away (works on refresh). I think it's because of the state handling in the useTenantContext relying on useState for derived data (from the search params) as opposed to getting and setting the search params directly

Also renamed useTenantContext -> useTenant since I think Context is a bit of a "reserved" thing in React (since this isn't really a Context, just a hook). And I also changed the return type of useTenant from [Tenant | undefined, (string) -> void] to an object so we can unpack that object as we need as opposed to needing e.g. indexing like [1] to get the setter out

Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 3:57pm

@mrkaye97
Copy link
Contributor Author

@grutt I think I realized why we did the last tenant thing so I'll add that back - if you get redirected to a page without the query param set, I think this will reset you to the default. will fix that

@mrkaye97 mrkaye97 merged commit 08db84e into main Jan 13, 2025
30 checks passed
@mrkaye97 mrkaye97 deleted the feat-fix-tenant-tenant-switching-state-delay branch January 13, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants