fix(projects): make freshly-added projects editable
Make workspace-less projects flow through aggregated project fetching and keep the settings screen editable immediately after adding one.
This commit is contained in:
@@ -169,7 +169,7 @@ export function useSidebarWorkspacesList(options?: {
|
||||
void (async () => {
|
||||
const next = new Map<string, WorkspaceDescriptor>();
|
||||
try {
|
||||
const workspaces = await fetchAllWorkspaceDescriptors({
|
||||
const { workspaces, emptyProjects } = await fetchAllWorkspaceDescriptors({
|
||||
client,
|
||||
sort: [{ key: "activity_at", direction: "desc" }],
|
||||
});
|
||||
@@ -181,6 +181,9 @@ export function useSidebarWorkspacesList(options?: {
|
||||
}
|
||||
const store = useSessionStore.getState();
|
||||
store.setWorkspaces(serverId, next);
|
||||
// Keep parents with no workspaces yet, so a manual refresh doesn't drop
|
||||
// a freshly-added project from the sidebar.
|
||||
store.setEmptyProjects(serverId, emptyProjects);
|
||||
store.setHasHydratedWorkspaces(serverId, true);
|
||||
} catch (error) {
|
||||
console.error("[WorkspaceFetch][sidebar-refresh] failed", {
|
||||
|
||||
Reference in New Issue
Block a user