Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Jul 5, 2023
1 parent 138bc95 commit 578cbcc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/lib/pages/migrate/components/MigrateContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const MigrateContract = ({
const enableMigrate =
!!address &&
codeId.length > 0 &&
migrateMsg.trim().length > 0 &&
jsonValidate(migrateMsg) === null &&
status.state === "success";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/json.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const jsonValidate = (text: string) => {
try {
if (text !== "") JSON.parse(text);
if (text.trim().length === 0)
throw new SyntaxError(`Can't use empty string`);
JSON.parse(text);
return null;
} catch (error) {
return (error as SyntaxError).message;
Expand Down

0 comments on commit 578cbcc

Please sign in to comment.