Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
fix: OPTIC-152: Uploading a text field but only 'true' is showing up …
Browse files Browse the repository at this point in the history
…not 'false'
  • Loading branch information
yyassi-heartex committed Jan 26, 2024
1 parent 003ed1d commit ea78792
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/CellViews/StringCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const valueToString = (value) => {
try {
return JSON.stringify(value);
} catch {
return value.toString();
/* if undefined or null we'll treat it as empty string, otherwise toString(), this will allow 0 and false to render properly */
return (value ?? "").toString();
}
};

Expand All @@ -18,7 +19,7 @@ export const StringCell = ({ value }) => {
lineHeight: "16px",
}}
>
{value ? valueToString(value) : ""}
{valueToString(value)}
</div>
);
};

0 comments on commit ea78792

Please sign in to comment.