diff options
| author | MaheshtheDev <[email protected]> | 2025-11-11 19:10:13 +0000 |
|---|---|---|
| committer | MaheshtheDev <[email protected]> | 2025-11-11 19:10:13 +0000 |
| commit | a88525feb0dcf7d46bebcb87be4125569bb5da3b (patch) | |
| tree | 3d620bd3e28fb77a559ebf4cc3ffdc46962b128a /packages | |
| parent | docs: personal assistant cookbook update (#575) (diff) | |
| download | supermemory-a88525feb0dcf7d46bebcb87be4125569bb5da3b.tar.xz supermemory-a88525feb0dcf7d46bebcb87be4125569bb5da3b.zip | |
fix: org switch issue on consumer when dev org exists (#577)11-11-fix_org_switch_issue_on_consumer_when_dev_org_exists
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/lib/auth-context.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/lib/auth-context.tsx b/packages/lib/auth-context.tsx index db24ec45..324b213e 100644 --- a/packages/lib/auth-context.tsx +++ b/packages/lib/auth-context.tsx @@ -41,15 +41,16 @@ export function AuthProvider({ children }: { children: ReactNode }) { authClient.organization .getFullOrganization() .then((org) => { - // TODO: Uncomment this when we have a way to handle consumer organizations better way - //if (org.metadata?.isConsumer === true) { - setOrg(org) - //} else { - // const consumerOrg = orgs?.find((o) => o.metadata?.isConsumer === true) - // if (consumerOrg) { - // setActiveOrg(consumerOrg.slug) - // } - //} + if (org.metadata?.isConsumer === true) { + console.log("Consumer organization:", org) + setOrg(org) + } else { + console.log("ALl orgs:", orgs) + const consumerOrg = orgs?.find((o) => o.metadata?.isConsumer === true) + if (consumerOrg) { + setActiveOrg(consumerOrg.slug) + } + } }) .catch((error) => { // Silently handle organization fetch failures to prevent unhandled rejections |