Skip to content

Commit

Permalink
Merge pull request #692 from appwrite/fix-redirection-issue
Browse files Browse the repository at this point in the history
fix: wrong redirection
  • Loading branch information
eldadfux authored Dec 28, 2023
2 parents 7a69d59 + 6f9e053 commit db0774d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/routes/console/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const load: PageLoad = async ({ parent, url }) => {

if (organizations.total) {
const teamId = account.prefs.organization ?? organizations.teams[0].$id;
throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
if (!teamId) {
throw redirect(303, `${base}/console/account/organizations${url.search ?? ''}`);
} else throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
} else {
throw redirect(303, `${base}/console/onboarding${url.search ?? ''}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/console/organization-[organization]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
};
} catch (e) {
const prefs = await sdk.forConsole.account.getPrefs();
const newPrefs = { ...prefs, organization: '' };
const newPrefs = { ...prefs, organization: null };
sdk.forConsole.account.updatePrefs(newPrefs);
localStorage.removeItem('organization');
throw error(e.code, e.message);
Expand Down

1 comment on commit db0774d

@vercel
Copy link

@vercel vercel bot commented on db0774d Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

console-preview – ./

console-preview-git-main-appwrite.vercel.app
console-next.vercel.app
console-preview-appwrite.vercel.app

Please sign in to comment.