refactor(workspace): omit unchanged registry state fields

This commit is contained in:
_Kerman committed 2026-09-20 17:20:54 +08:00
1 parent 3a7f8f9657
commit 2cd03c9758
1 file changed
+1 -12
+1 -12
View File
@@ -459,8 +459,6 @@ export class WorkspaceRegistry extends Service {
initialized: true,
...(firstUse ? { defaultWorkspaceId: id } : {}),
workspaceIds: [id, ...state.workspaceIds],
archivedSessionIds: state.archivedSessionIds,
pinnedSessionIds: state.pinnedSessionIds,
})
} catch (error) {
this.entities.delete(id)
@@ -494,8 +492,6 @@ export class WorkspaceRegistry extends Service {
pendingMutation: undefined,
initialized: true,
workspaceIds: state.workspaceIds.filter(workspaceId => workspaceId !== id),
archivedSessionIds: state.archivedSessionIds,
pinnedSessionIds: state.pinnedSessionIds,
}
await this.setState({
...nextState,
@@ -549,14 +545,7 @@ export class WorkspaceRegistry extends Service {
)
}
await this.requireTable().delete(pending.workspaceId)
await this.setState({
...state,
pendingMutation: undefined,
initialized: state.initialized,
workspaceIds: state.workspaceIds,
archivedSessionIds: state.archivedSessionIds,
pinnedSessionIds: state.pinnedSessionIds,
})
await this.setState({ ...state, pendingMutation: undefined })
}
private async bootstrap(headers: readonly SessionHeader[]): Promise<void> {