Skip to content

Commit

Permalink
fix(GoalPreview): automatically open early opened GoalEditForm modal
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats committed May 18, 2023
1 parent 36a8552 commit a522646
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/GoalPreview/GoalPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ const GoalPreview: React.FC<GoalPreviewProps> = ({ preview, onClose, onDelete })
setGoalEditModalVisible(true);
}, []);

const onGoalEditModalClose = useCallback(() => {
setGoalEditModalVisible(false);
}, []);

const updateGoal = useGoalUpdate(preview.id);
const { reactionsProps, goalReaction, commentReaction } = useReactionsResource(goal?.reactions);

Expand Down Expand Up @@ -352,6 +356,7 @@ const GoalPreview: React.FC<GoalPreviewProps> = ({ preview, onClose, onDelete })
hotkeys={editGoalKeys}
visible={goalEditModalVisible}
onShow={onGoalEditModalShow}
onClose={onGoalEditModalClose}
>
<GoalEditForm goal={g} onSubmit={onGoalEdit} />
</ModalOnEvent>
Expand Down

0 comments on commit a522646

Please sign in to comment.