Skip to content

Commit

Permalink
Refactor to bail early
Browse files Browse the repository at this point in the history
  • Loading branch information
will-stone committed Apr 2, 2024
1 parent 8d33feb commit 9144994
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/renderers/picker/components/organisms/update-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ const UpdateBar: React.FC = () => {
const dispatch = useDispatch()
const updateStatus = useSelector((state) => state.data.updateStatus)

if (updateStatus === 'available') {
return (
<button
className={clsx(
'w-full shrink-0 pb-1',
'text-center text-xs dark:text-gray-400',
'cursor-default',
)}
onClick={() => dispatch(clickedUpdateBar())}
type="button"
>
Update Available
</button>
)
if (updateStatus !== 'available') {
return null
}

return null
return (
<button
className={clsx(
'w-full shrink-0 pb-1',
'text-center text-xs dark:text-gray-400',
'cursor-default',
)}
onClick={() => dispatch(clickedUpdateBar())}
type="button"
>
Update Available
</button>
)
}

export default UpdateBar

0 comments on commit 9144994

Please sign in to comment.