From fffe4b2f18d3869042ff7b7abdccbbb007bad511 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Mon, 22 Jul 2024 13:17:26 -0400 Subject: [PATCH] Fix for typescript 5.0 breaking change - forbidden implicit coercions in relational operators --- .../src/features/builder/components/BaseNode.tsx | 4 ++-- .../src/features/builder/components/NodeTree.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/snaps-simulator/src/features/builder/components/BaseNode.tsx b/packages/snaps-simulator/src/features/builder/components/BaseNode.tsx index 26f804fbf6..6cc47f633e 100644 --- a/packages/snaps-simulator/src/features/builder/components/BaseNode.tsx +++ b/packages/snaps-simulator/src/features/builder/components/BaseNode.tsx @@ -39,7 +39,7 @@ export const BaseNode: FunctionComponent = ({ borderColor="border.default" display={isDragging ? 'none' : 'flex'} marginX="4" - cursor={node.id > 1 ? 'move' : 'default'} + cursor={Number(node.id) > 1 ? 'move' : 'default'} > = ({ {node.data.type} {children} - {node.id >= 2 && ( + {Number(node.id) >= 2 && ( = ({ const handleCanDrag = (node?: NodeModel) => { if (node) { - return node.id >= 2; + return Number(node.id) >= 2; } return false; @@ -113,7 +113,7 @@ export const NodeTree: FunctionComponent = ({ return ( canDropElement(dropTarget?.data, dragSource?.data) && dropTarget?.droppable && - dropTargetId > 0 + Number(dropTargetId) > 0 ); }