refactor: fix potential issues when converting to string [no ci]
This commit is contained in:
@@ -209,7 +209,7 @@ const Modal = ({
|
||||
<Button
|
||||
primary={action.type === 'primary'}
|
||||
colorStyle={action.type === 'destructive' ? 'danger' : undefined}
|
||||
key={action.label.toString()}
|
||||
key={index}
|
||||
onClick={action.onClick}
|
||||
className={classNames(
|
||||
action.mobileSlot ? 'hidden md:block' : '',
|
||||
|
||||
@@ -75,7 +75,7 @@ const CompoundPredicateBuilder = ({ controller }: Props) => {
|
||||
{predicate.keypath && (
|
||||
<PredicateValue
|
||||
keypath={predicate.keypath as PredicateKeypath}
|
||||
value={predicate.value.toString()}
|
||||
value={typeof predicate.value !== 'string' ? JSON.stringify(predicate.value) : predicate.value}
|
||||
setValue={(value: string) => {
|
||||
setPredicate(index, { value })
|
||||
}}
|
||||
|
||||
@@ -221,8 +221,8 @@ export const getBase64FromBlob = (blob: Blob) => {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
reader.onloadend = () => {
|
||||
if (reader.result) {
|
||||
resolve(reader.result.toString())
|
||||
if (reader.result && typeof reader.result === 'string') {
|
||||
resolve(reader.result)
|
||||
} else {
|
||||
reject()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user