Skip to content

Commit

Permalink
use Array.prototype.find
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Mar 2, 2023
1 parent 9798f54 commit 362b867
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/next-core/js/src/overlay/internal/container/Errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ export function Errors({ issues, errors }: ErrorsProps) {
const isClosable = true;

const defaultTab =
TAB_PRIORITY.filter(
TAB_PRIORITY.find(
(tabId) =>
({
[TabId.TurbopackErrors]: turbopackErrors.length > 0,
[TabId.TurbopackWarnings]: turbopackWarnings.length > 0,
[TabId.RuntimeErrors]: hasErrors,
}[tabId])
)[0] ?? TabId.RuntimeErrors;
) ?? TabId.RuntimeErrors;

const [selectedTab, setSelectedTab] = React.useState<string>(defaultTab);

Expand Down

0 comments on commit 362b867

Please sign in to comment.