Skip to content

Commit

Permalink
Fix for typescript 5.0 breaking change - forbidden implicit coercions…
Browse files Browse the repository at this point in the history
… in relational operators
  • Loading branch information
MajorLift committed Jul 22, 2024
1 parent 3178d79 commit fffe4b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const BaseNode: FunctionComponent<BaseNodeProps> = ({
borderColor="border.default"
display={isDragging ? 'none' : 'flex'}
marginX="4"
cursor={node.id > 1 ? 'move' : 'default'}
cursor={Number(node.id) > 1 ? 'move' : 'default'}

Check warning on line 42 in packages/snaps-simulator/src/features/builder/components/BaseNode.tsx

View check run for this annotation

Codecov / codecov/patch

packages/snaps-simulator/src/features/builder/components/BaseNode.tsx#L42

Added line #L42 was not covered by tests
>
<Icon icon={node.data.type.toLowerCase() as IconName} width="16px" />
<Text
Expand All @@ -53,7 +53,7 @@ export const BaseNode: FunctionComponent<BaseNodeProps> = ({
{node.data.type}
</Text>
{children}
{node.id >= 2 && (
{Number(node.id) >= 2 && (

Check warning on line 56 in packages/snaps-simulator/src/features/builder/components/BaseNode.tsx

View check run for this annotation

Codecov / codecov/patch

packages/snaps-simulator/src/features/builder/components/BaseNode.tsx#L56

Added line #L56 was not covered by tests
<Icon
icon="cross"
width="11px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const NodeTree: FunctionComponent<NodeTreeProps> = ({

const handleCanDrag = (node?: NodeModel<JSXElement>) => {
if (node) {
return node.id >= 2;
return Number(node.id) >= 2;

Check warning on line 102 in packages/snaps-simulator/src/features/builder/components/NodeTree.tsx

View check run for this annotation

Codecov / codecov/patch

packages/snaps-simulator/src/features/builder/components/NodeTree.tsx#L102

Added line #L102 was not covered by tests
}

return false;
Expand All @@ -113,7 +113,7 @@ export const NodeTree: FunctionComponent<NodeTreeProps> = ({
return (
canDropElement(dropTarget?.data, dragSource?.data) &&
dropTarget?.droppable &&
dropTargetId > 0
Number(dropTargetId) > 0

Check warning on line 116 in packages/snaps-simulator/src/features/builder/components/NodeTree.tsx

View check run for this annotation

Codecov / codecov/patch

packages/snaps-simulator/src/features/builder/components/NodeTree.tsx#L116

Added line #L116 was not covered by tests
);
}

Expand Down

0 comments on commit fffe4b2

Please sign in to comment.