Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Mar 15, 2024
1 parent 9886bc5 commit bbd1bb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/databases/PlayerSearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function PlayerSearchInput({
setValue,
}: {
label: string;
value: number | null;
value?: number;
file: string;
rightSection?: ReactNode;
setValue: (val: number | undefined) => void;
Expand All @@ -22,7 +22,7 @@ export function PlayerSearchInput({
const [data, setData] = useState<Player[]>([]);

useEffect(() => {
if (value !== null) {
if (value !== undefined) {
commands.getPlayer(file, value).then((res) => {
const player = unwrap(res);
if (player?.name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function LocalOptionsPanel({ boardFen }: { boardFen: string }) {
{options.path && (
<PlayerSearchInput
label={"Search"}
value={options.player}
value={options.player ?? undefined}
file={options.path}
setValue={(v) => setOptions((q) => ({ ...q, player: v || null }))}
/>
Expand Down

0 comments on commit bbd1bb8

Please sign in to comment.