Use array find instead of filter

This commit is contained in:
Florian Scholdei
2020-09-21 11:01:22 +02:00
parent b7d3a17ee5
commit 2de30a2224

View File

@@ -70,7 +70,7 @@ class ChangesetsRoot extends React.Component<Props> {
}
const url = urls.stripEndingSlash(match.url);
const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0];
const defaultBranch = branches?.find(b => b.defaultBranch === true);
return (
<>