14 lines
466 B
TypeScript
14 lines
466 B
TypeScript
import type { ModelOption } from "../../lib/modelOptions";
|
|
|
|
/** Preserve staged provider options when the highlighted model is tapped again. */
|
|
export function pendingModelAfterPress(input: {
|
|
readonly current: ModelOption | null;
|
|
readonly pressed: ModelOption;
|
|
readonly pressedIsApplied: boolean;
|
|
}): ModelOption | null {
|
|
if (input.pressedIsApplied) {
|
|
return null;
|
|
}
|
|
return input.current?.key === input.pressed.key ? input.current : input.pressed;
|
|
}
|