From 7e9ce0016682e828b7ddda6cd0d07081f5bbf67b Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 2 Feb 2026 19:33:35 -0500 Subject: [PATCH] have the project id default to whatever select when open new task --- src/views/ChoreEdit/ChoreEdit.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/ChoreEdit/ChoreEdit.jsx b/src/views/ChoreEdit/ChoreEdit.jsx index 0d73c28..5371dcf 100644 --- a/src/views/ChoreEdit/ChoreEdit.jsx +++ b/src/views/ChoreEdit/ChoreEdit.jsx @@ -43,6 +43,7 @@ import { isPlusAccount } from '../../utils/Helpers' import Priorities from '../../utils/Priorities.jsx' import { getIconComponent } from '../../utils/ProjectIcons' import { getSafeBottomPadding } from '../../utils/SafeAreaUtils.js' +import { useProjectFilter } from '../Chores/hooks/useProjectFilter.js' import LoadingComponent from '../components/Loading.jsx' import RichTextEditor from '../components/RichTextEditor.jsx' import SubTasks from '../components/SubTask.jsx' @@ -102,7 +103,6 @@ const ChoreEdit = () => { const [allUserThings, setAllUserThings] = useState([]) const [thingTrigger, setThingTrigger] = useState(null) const [isThingValid, setIsThingValid] = useState(false) - const [projectId, setProjectId] = useState('default') const [notificationMetadata, setNotificationMetadata] = useState({}) @@ -123,6 +123,14 @@ const ChoreEdit = () => { const { data: userLabelsRaw, isLoading: isUserLabelsLoading } = useLabels() const { data: projects = [], isLoading: isProjectsLoading } = useProjects() + + const { selectedProject, projectsWithDefault, setSelectedProjectWithCache } = + useProjectFilter(projects) + + const [projectId, setProjectId] = useState( + selectedProject ? selectedProject.id : 'default', + ) + const updateChoreMutation = useUpdateChore() const createChoreMutation = useCreateChore() const archiveChore = useArchiveChore()