Skip to content

Commit 11ec03a

Browse files
committed
Calendar-Pomodoro:improve:取消计时不再保存笔记缓存
1 parent e3d5137 commit 11ec03a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Calendar-Pomodoro/components/CalendarTimerView.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,16 @@ export function CalendarTimerView() {
997997
await clearNotifications();
998998
await endLiveActivity(activeTask, now, total);
999999
await persistSessionState(null);
1000+
1001+
// 取消后不应保留本次会话草稿,避免下次启动同任务时带出旧笔记。
1002+
setTasks((prev) => {
1003+
const next = prev.map((t) =>
1004+
t.id === activeTask.id ? { ...t, noteDraft: "" } : t,
1005+
);
1006+
void saveTasks(next);
1007+
return next;
1008+
});
1009+
setNoteDraft("");
10001010
}
10011011

10021012
async function stopTimer(options?: { auto?: boolean }) {

0 commit comments

Comments
 (0)