Skip to content

Commit

Permalink
chore: length first
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Oct 8, 2024
1 parent 22d6e5a commit ed03f9d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,15 @@ const useDashboardState = (

useEffect(() => {
const setDefaultFlag =
flags.length &&
(!state.activeFlag ||
!flags.some((flag) => flag.name === state.activeFlag?.name)) &&
flags.length;

!flags.some((flag) => flag.name === state.activeFlag?.name));
const setDefaultProject =
projects.length &&
(!state.activeProject ||
!projects.some(
(project) => project.id === state.activeProject,
)) &&
projects.length;
));

if (setDefaultFlag || setDefaultProject) {
setState({
Expand Down

0 comments on commit ed03f9d

Please sign in to comment.