We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29f5e8f commit 93ed09bCopy full SHA for 93ed09b
src/page/todo/lowerTodo/hook/useLowerTodoAI.tsx
@@ -78,11 +78,13 @@ export const useLowerTodoAI = ({
78
goals.forEach((goal, goalIndex) => {
79
if (goalIndex < emptyIndices.length) {
80
const targetIndex = emptyIndices[goalIndex];
81
- const [cycleText, originalTitle] = goal.title.split('/');
+ const match = goal.title.match(/^(매일|매주|한 번)\/(.+)$/);
82
+ const titleText = match ? match[2] : goal.title;
83
+ const cycleText = match ? match[1] : '매일';
84
85
const newTodo = {
- title: originalTitle || goal.title,
- cycle: convertCycleToEnglish(cycleText || '매일'),
86
+ title: titleText,
87
+ cycle: convertCycleToEnglish(cycleText),
88
};
89
90
updatedTodos[targetIndex] = newTodo;
0 commit comments