Skip to content

Commit

Permalink
refactor(parameters): Make this boolean assertion prettier :)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnslig committed Jul 20, 2021
1 parent 660ed2f commit ef2d127
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/common/hooks/api/useParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const useScopedParameterResponse = (
* @returns Whether any of the parameters has reached its minimum
*/
export const useIsGameOver = (data?: ParameterApiResponse) => {
return !data
? false
: data.data.some(({ attributes }) => attributes.value <= attributes.min);
return (
data &&
data.data.some(({ attributes }) => attributes.value <= attributes.min)
);
};

0 comments on commit ef2d127

Please sign in to comment.