Skip to content

Commit 2fb46b1

Browse files
committed
fmt
1 parent 08afa27 commit 2fb46b1

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/desktop/src/routes/editor/TranscriptPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ function TranscriptEditor(props: {
465465
} else {
466466
props.onDeleteWords(indices);
467467
}
468-
setSelectedIndices(new Set());
468+
setSelectedIndices(new Set<number>());
469469
setAnchorIndex(-1);
470470
} else if (e.key === "ArrowLeft") {
471471
e.preventDefault();
@@ -488,7 +488,7 @@ function TranscriptEditor(props: {
488488

489489
const handleContainerClick = (e: MouseEvent) => {
490490
if (e.target === scrollContainerRef) {
491-
setSelectedIndices(new Set());
491+
setSelectedIndices(new Set<number>());
492492
setAnchorIndex(-1);
493493
}
494494
};
@@ -544,7 +544,7 @@ function TranscriptEditor(props: {
544544
} else {
545545
props.onDeleteWord(flatIndexOf(word));
546546
}
547-
setSelectedIndices(new Set());
547+
setSelectedIndices(new Set<number>());
548548
setAnchorIndex(-1);
549549
};
550550

apps/desktop/src/routes/editor/context.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,19 @@ export type LayoutMode = { type: "export" } | { type: "transcript" };
6969
export type CurrentDialog = ModalDialog | LayoutMode;
7070

7171
export type DialogState = { open: false } | ({ open: boolean } & CurrentDialog);
72+
export type OpenLayoutMode = { open: true } & LayoutMode;
73+
export type OpenModalDialog = { open: true } & ModalDialog;
7274

7375
const LAYOUT_MODE_TYPES: Set<CurrentDialog["type"]> = new Set([
7476
"export",
7577
"transcript",
7678
]);
7779

78-
export function isLayoutMode(d: DialogState): boolean {
80+
export function isLayoutMode(d: DialogState): d is OpenLayoutMode {
7981
return d.open && "type" in d && LAYOUT_MODE_TYPES.has(d.type);
8082
}
8183

82-
export function isModalDialog(d: DialogState): boolean {
84+
export function isModalDialog(d: DialogState): d is OpenModalDialog {
8385
return d.open && "type" in d && !LAYOUT_MODE_TYPES.has(d.type);
8486
}
8587

0 commit comments

Comments
 (0)