Skip to content

Commit

Permalink
refactor(*): remove isFalsy
Browse files Browse the repository at this point in the history
  • Loading branch information
GervinFung committed Sep 22, 2024
1 parent 0ba757b commit 7824dd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions apps/web/pages/templates/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
Optional,
formQueryParamStringFromRecord,
Defined,
isFalsy,
} from '@poolofdeath20/util';
import { saveAs } from 'file-saver';
import iwanthue from 'iwanthue';
Expand Down Expand Up @@ -420,7 +419,7 @@ const Templates = () => {
<ButtonGroup gap={4}>
<Button
colorScheme="messenger"
isDisabled={isFalsy(selected.length)}
isDisabled={!selected.length}
onClick={() => {
copyNotification.unset();
clipboard.copy(combineTemplates(selected));
Expand All @@ -431,7 +430,7 @@ const Templates = () => {
<Divider orientation="vertical" />
<Button
colorScheme="messenger"
isDisabled={isFalsy(selected.length)}
isDisabled={!selected.length}
onClick={() => {
const zip = selected.reduce(
(zip, template) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/web/components/templates/query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DeepReadonly } from '@poolofdeath20/util';

import { Box, Text } from '@chakra-ui/react';
import styled from '@emotion/styled';
import { equalTo, isFalsy } from '@poolofdeath20/util';
import { equalTo } from '@poolofdeath20/util';
import Fuse from 'fuse.js';
import React from 'react';
import Select from 'react-select';
Expand Down Expand Up @@ -69,7 +69,7 @@ const QuerySection = (
.at(0)?.score ?? 1) <= 0.5
);
}}
isDisabled={isFalsy(props.templates.all.length)}
isDisabled={!props.templates.all.length}
isMulti
loadingMessage={() => {
return (
Expand Down

0 comments on commit 7824dd3

Please sign in to comment.