Fixed bugs with organizations and sidebars

This commit is contained in:
Vladyslav Matsiiako
2023-02-13 17:27:21 -08:00
parent 6f6df3e63a
commit 190391e493
4 changed files with 23 additions and 30 deletions
@@ -27,7 +27,7 @@ export const OrgProvider = ({ children }: Props): JSX.Element => {
const value = useMemo<TOrgContext>(
() => ({
orgs: userOrgs,
currentOrg: (userOrgs || []).find(({ _id }) => _id === currentWsOrgID),
currentOrg: (userOrgs || []).find(({ _id }) => _id === currentWsOrgID) || (userOrgs || [])[0],
isLoading
}),
[currentWsOrgID, userOrgs, isLoading]