From 7ca13f57f66a598f4a706c89de4fb8ce4456c94a Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Tue, 28 Nov 2023 15:14:36 -0500 Subject: [PATCH] Fixes org switching --- .../app/AccountNavigation/OrgMenu.svelte | 95 ++++++++++--------- .../app/AccountNavigation/OrgPicker.svelte | 4 +- 2 files changed, 52 insertions(+), 47 deletions(-) diff --git a/src/pages/app/AccountNavigation/OrgMenu.svelte b/src/pages/app/AccountNavigation/OrgMenu.svelte index 1f4c13c57..796880aaa 100644 --- a/src/pages/app/AccountNavigation/OrgMenu.svelte +++ b/src/pages/app/AccountNavigation/OrgMenu.svelte @@ -42,9 +42,9 @@ return orgs; } - async function changeOrg(id) { - changeActive(id); - getOrgPromise = getOrg(id); + async function changeOrg(org) { + changeActive(org); + getOrgPromise = getOrg(org.id); } let getOrgPromise = getOrg(org.id); @@ -70,6 +70,9 @@ color: var(--gray); margin: 0; } + .medium-width { + min-width: 20rem; + } {#await getOrgPromise} @@ -102,20 +105,21 @@ - {#if isPremiumOrg(activeOrg)} - - - - - {:else if isOrgAdmin(user)} - -
-

- {$_("authSection.premiumUpgrade.orgHeading")} -

-

- {$_("authSection.premiumUpgrade.orgDescription")} -

-
- -
- {/if} - - {#await listOrgsPromise then orgOptions} - {#if orgOptions.length > 1} - + {/if} - {/await} + + {#await listOrgsPromise then orgOptions} + {#if orgOptions.length > 1} + + {/if} + {/await} +
{/if} diff --git a/src/pages/app/AccountNavigation/OrgPicker.svelte b/src/pages/app/AccountNavigation/OrgPicker.svelte index a2fd72159..f5bf8843c 100644 --- a/src/pages/app/AccountNavigation/OrgPicker.svelte +++ b/src/pages/app/AccountNavigation/OrgPicker.svelte @@ -12,7 +12,7 @@ export let activeOrg: Org; export let loading = false; export let orgOptions: Org[] = []; - export let handleChange: (id: string) => void = () => {}; + export let handleChange: (org: Org) => void = () => {};