chore: bump version to 2.23.10 and enhance workspace loading logic (#447)
* chore: bump version to 2.23.10 and enhance workspace loading logic - Updated application version from 2.23.9 to 2.23.10 in package.json. - Refactored workspace loading functions to use async/await for improved error handling and added redirects for missing workspaces or users. - Updated sidebar layout components to handle asynchronous data fetching and redirection more effectively. - Minor adjustments to personal account dropdown styles for consistency.
This commit is contained in:
committed by
GitHub
parent
2835c163cb
commit
255ba19766
@@ -1,6 +1,7 @@
|
||||
import { use } from 'react';
|
||||
|
||||
import { cookies } from 'next/headers';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -33,14 +34,20 @@ function TeamWorkspaceLayout({ children, params }: TeamWorkspaceLayoutProps) {
|
||||
return <HeaderLayout account={account}>{children}</HeaderLayout>;
|
||||
}
|
||||
|
||||
function SidebarLayout({
|
||||
async function SidebarLayout({
|
||||
account,
|
||||
children,
|
||||
}: React.PropsWithChildren<{
|
||||
account: string;
|
||||
}>) {
|
||||
const data = use(loadTeamWorkspace(account));
|
||||
const state = use(getLayoutState(account));
|
||||
const [data, state] = await Promise.all([
|
||||
loadTeamWorkspace(account),
|
||||
getLayoutState(account),
|
||||
]);
|
||||
|
||||
if (!data) {
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
const accounts = data.accounts.map(({ name, slug, picture_url }) => ({
|
||||
label: name,
|
||||
|
||||
Reference in New Issue
Block a user