diff --git a/src/projects/detail/components/SimplePlan/components/AddCopilotsSidebar/AddCopilotsSidebar.jsx b/src/projects/detail/components/SimplePlan/components/AddCopilotsSidebar/AddCopilotsSidebar.jsx index 1b12cf1f7..733933f3f 100644 --- a/src/projects/detail/components/SimplePlan/components/AddCopilotsSidebar/AddCopilotsSidebar.jsx +++ b/src/projects/detail/components/SimplePlan/components/AddCopilotsSidebar/AddCopilotsSidebar.jsx @@ -31,11 +31,11 @@ class AddCopilotsSidebar extends React.Component { } componentDidMount() { - document.addEventListener('click', this.onClickOutside) + document.addEventListener('mousedown', this.onClickOutside) } componentWillUnmount() { - document.removeEventListener('click', this.onClickOutside) + document.removeEventListener('mousedown', this.onClickOutside) } render() { diff --git a/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx b/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx index 8582868ea..f0873ded3 100644 --- a/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx +++ b/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx @@ -28,6 +28,8 @@ class MilestonesApprovalNotification extends React.Component { } findLatest(approvals) { + if(!approvals) return {} + let d = null let maxIndex = 0 for(let index = 0; index < approvals.length; index ++) {