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:
Giancarlo Buomprisco
2026-01-23 11:12:49 +01:00
committed by GitHub
parent 2835c163cb
commit 255ba19766
4 changed files with 28 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import { use } from 'react';
import { cookies } from 'next/headers';
import { redirect } from 'next/navigation';
import { z } from 'zod';
@@ -30,9 +31,15 @@ function UserHomeLayout({ children }: React.PropsWithChildren) {
export default withI18n(UserHomeLayout);
function SidebarLayout({ children }: React.PropsWithChildren) {
const workspace = use(loadUserWorkspace());
const state = use(getLayoutState());
async function SidebarLayout({ children }: React.PropsWithChildren) {
const [workspace, state] = await Promise.all([
loadUserWorkspace().catch(() => null),
getLayoutState(),
]);
if (!workspace) {
redirect('/');
}
return (
<UserWorkspaceContextProvider value={workspace}>