mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-28 16:09:17 +00:00
16 lines
488 B
TypeScript
16 lines
488 B
TypeScript
export interface QueryExecutionStateLike {
|
|
isExecuting: boolean;
|
|
isCancelling?: boolean;
|
|
executionId?: string;
|
|
}
|
|
|
|
export function canCancelQueryExecution(state: QueryExecutionStateLike): boolean {
|
|
return state.isExecuting && !!state.executionId && !state.isCancelling;
|
|
}
|
|
|
|
export function queryExecutionLabelKey(
|
|
state: Pick<QueryExecutionStateLike, "isCancelling">,
|
|
): "common.loading" | "common.stopping" {
|
|
return state.isCancelling ? "common.stopping" : "common.loading";
|
|
}
|