Skip to content

Commit db0774d

Browse files
authored
Merge pull request #692 from appwrite/fix-redirection-issue
fix: wrong redirection
2 parents 7a69d59 + 6f9e053 commit db0774d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/routes/console/+page.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export const load: PageLoad = async ({ parent, url }) => {
77

88
if (organizations.total) {
99
const teamId = account.prefs.organization ?? organizations.teams[0].$id;
10-
throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
10+
if (!teamId) {
11+
throw redirect(303, `${base}/console/account/organizations${url.search ?? ''}`);
12+
} else throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
1113
} else {
1214
throw redirect(303, `${base}/console/onboarding${url.search ?? ''}`);
1315
}

src/routes/console/organization-[organization]/+layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
4141
};
4242
} catch (e) {
4343
const prefs = await sdk.forConsole.account.getPrefs();
44-
const newPrefs = { ...prefs, organization: '' };
44+
const newPrefs = { ...prefs, organization: null };
4545
sdk.forConsole.account.updatePrefs(newPrefs);
4646
localStorage.removeItem('organization');
4747
throw error(e.code, e.message);

0 commit comments

Comments
 (0)