Skip to content

Commit

Permalink
fix: fix TaskDetails being overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
DasProffi authored Aug 6, 2023
1 parent d766370 commit 6c94e2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tasks/components/layout/PatientDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export const PatientDetail = ({
return <div>Loading PatientDetails!</div>
}

const isShowingTask = (!!taskID || taskID === '')

return (
<div className={tw('relative flex flex-col py-4 px-6')}>
{isShowingSavedNotification &&
Expand All @@ -125,7 +127,7 @@ export const PatientDetail = ({
confirmType="negative"
/>
{/* taskID === '' is create and if set it's the tasks id */}
{(!!taskID || taskID === '') && (
{isShowingTask && (
<TaskDetailModal
isOpen={true}
onBackgroundClick={() => setTaskID(undefined)}
Expand Down
4 changes: 2 additions & 2 deletions tasks/components/layout/TaskDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ export const TaskDetailView = ({
const deleteTaskMutation = useTaskDeleteMutation(onClose)

useEffect(() => {
if (data) {
if (data && taskID) {
setTask(data)
}
}, [data])
}, [data, taskID])

const {
data: personalTaskTemplatesData,
Expand Down

0 comments on commit 6c94e2a

Please sign in to comment.