Co-authored-by: SuLe <sule@SuLedeMacBook-Air.local> Co-authored-by: skyler <77960507+t8y2@users.noreply.github.com>
14 lines
483 B
TypeScript
14 lines
483 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";
|
|
}
|