Skip to content

Commit 2a65b91

Browse files
committed
fix: some bugs in task builder
1 parent 5fee655 commit 2a65b91

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

apps/desktop-v2/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function Home() {
9898
</div>
9999
) : taskFetchState.status === "success" ? (
100100
<div
101-
className="flex flex-col items-center w-full max-h-full gap-2 overflow-clip max-w-xl"
101+
className="flex flex-col items-center w-full max-h-full gap-2 max-w-xl"
102102
ref={taskListRef}
103103
>
104104
<hr className="w-64" />
@@ -148,7 +148,7 @@ function Home() {
148148
</Accordion.AccordionTrigger>
149149
<Accordion.AccordionContent className="py-2">
150150
<div
151-
className="flex flex-col items-center w-full max-h-full gap-2 overflow-clip"
151+
className="flex flex-col items-center w-full max-h-full gap-2 overflow-scroll"
152152
ref={taskListRef}
153153
>
154154
{doneTasks.map((task, doneIndex) => (

apps/desktop-v2/components/task-builder-dialog.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ export const TaskBuilderDialog = (props: {
9595
}
9696
// extract the start at time if any
9797
const extractedStartAt = extractStartAt(newTitle);
98+
// if the start at time is present, then set the start time to the start at time
9899
let startTime: Date | undefined = props.editingTask.startTime;
99100
if (extractedStartAt !== null) {
101+
// start time input is present -> init start time
102+
// if initially the start time was not set
103+
if (startTime === undefined) {
104+
startTime = new Date();
105+
}
100106
// set only the interdate part
101107
startTime?.setHours(extractedStartAt.value.getHours());
102108
startTime?.setMinutes(extractedStartAt.value.getMinutes());
@@ -105,6 +111,9 @@ export const TaskBuilderDialog = (props: {
105111
newTitle.slice(
106112
extractedStartAt.match.index + extractedStartAt.match[0].length
107113
);
114+
} else {
115+
// start time input is not present -> remove the start time
116+
startTime = undefined;
108117
}
109118

110119
// extract the date if any

0 commit comments

Comments
 (0)