Skip to content

Commit

Permalink
Merge pull request #3068 from cardano-foundation/fix/display-with-key…
Browse files Browse the repository at this point in the history
…-is-number

fix: display keys as number
  • Loading branch information
Sotatek-TaiTruong authored Feb 28, 2024
2 parents 0bac748 + b92cd9a commit 3cc5426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commons/hooks/useDisableJsonKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const useDisableJsonKey = (data: unknown): { trigger: () => void; keyRenderer: J
return <Box data-row-id="json-row" />;
};
keyRenderer.when = ({ path }) => {
const num = Number(path[path.length - 1]);
const newNum = path.filter((i) => typeof i === "number");
const num = Number(newNum[newNum.length - 1]);
return !isNaN(num) && num < MAX_INDEX;
};
return { keyRenderer, trigger };
Expand Down

0 comments on commit 3cc5426

Please sign in to comment.