Skip to content

Commit

Permalink
Merge pull request #28 from h-be/bug-fix-ui
Browse files Browse the repository at this point in the history
fix ui bugs
  • Loading branch information
Connoropolous authored Sep 17, 2021
2 parents c473a11 + 3dfc05d commit c7dcd32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 12 additions & 1 deletion web/src/drawing/eventDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export function checkForEdgeAtCoordinates(
? goals[edge.parent_address].content
: ''

// do not proceed if we don't have coordinates
// for the goals of this edge (yet)
if (!parentGoalCoords || !childGoalCoords) {
return
}

// get the coordinates for the edge end points
const [
childEdgeCoords,
Expand Down Expand Up @@ -99,6 +105,11 @@ export function checkForGoalAtCoordinates(
.forEach(goal => {
// convert the topLeft and bottomRight points of the goal to canvas
const coords = goalCoordinates[goal.address]

// do not proceed if we don't have coordinates
// for the goal (yet)
if (!coords) return

const bottomRight = {
x: coords.x + goalWidth,
y: coords.y + getGoalHeight(ctx, goal.content),
Expand All @@ -107,7 +118,7 @@ export function checkForGoalAtCoordinates(
// if click occurred within the box of a Goal
if (
convertedClick.x >= coords.x &&
(convertedClick.x <= bottomRight.x) & (convertedClick.y >= coords.y) &&
(convertedClick.x <= bottomRight.x) && (convertedClick.y >= coords.y) &&
convertedClick.y <= bottomRight.y
) {
clickedAddress = goal.address
Expand Down
3 changes: 1 addition & 2 deletions web/src/routes/Dashboard/DashboardListProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ function DashboardListProject({
{project.members.map(
(member) =>
member && (
<div className="dashboard-list-project-member-wrapper">
<div key={member.address} className="dashboard-list-project-member-wrapper">
<Avatar
key={member.address}
first_name={member.first_name}
last_name={member.last_name}
avatar_url={member.avatar_url}
Expand Down

0 comments on commit c7dcd32

Please sign in to comment.