Skip to content

Commit f0af593

Browse files
Simplify comparisons with undefined
1 parent 08a8d63 commit f0af593

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/ql-vscode/src/view/results/alert-table-header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function AlertTableHeader({
1313
sortState?: InterpretedResultsSortState;
1414
}) {
1515
const sortClass = useCallback((): string => {
16-
if (sortState !== undefined && sortState.sortBy === "alert-message") {
16+
if (sortState?.sortBy === "alert-message") {
1717
return sortState.sortDirection === SortDirection.asc
1818
? "sort-asc"
1919
: "sort-desc";
@@ -26,7 +26,7 @@ export function AlertTableHeader({
2626
| InterpretedResultsSortState
2727
| undefined => {
2828
const prevDirection =
29-
sortState && sortState.sortBy === "alert-message"
29+
sortState?.sortBy === "alert-message"
3030
? sortState.sortDirection
3131
: undefined;
3232
const nextDirection = nextSortDirection(prevDirection, true);

0 commit comments

Comments
 (0)