Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

thread-settings-sheet-state.ts

13 lines466 Bytes

1import type { ModelOption } from "../../lib/modelOptions";
2​
3/** Preserve staged provider options when the highlighted model is tapped again. */
4export function pendingModelAfterPress(input: {
5 readonly current: ModelOption | null;
6 readonly pressed: ModelOption;
7 readonly pressedIsApplied: boolean;
8}): ModelOption | null {
9 if (input.pressedIsApplied) {
10 return null;
11 }
12 return input.current?.key === input.pressed.key ? input.current : input.pressed;