16 lines
418 B
TypeScript
16 lines
418 B
TypeScript
export type WorkspaceContextState = {
|
|
workspaces: { activeId: string | null };
|
|
workspaceContextGeneration: number;
|
|
};
|
|
|
|
export function isCurrentWorkspaceContext(
|
|
state: WorkspaceContextState,
|
|
requestedWorkspaceId: string | null,
|
|
requestedGeneration: number,
|
|
): boolean {
|
|
return (
|
|
state.workspaces.activeId === requestedWorkspaceId &&
|
|
state.workspaceContextGeneration === requestedGeneration
|
|
);
|
|
}
|