web: set note title as default reminder title

This commit is contained in:
Abdullah Atta
2023-02-09 13:36:48 +05:00
committed by Abdullah Atta
parent 82a80269d3
commit b7af3d92c9

View File

@@ -133,6 +133,15 @@ export default function AddReminderDialog(props: AddReminderDialogProps) {
setDescription(reminder.description);
}, [reminderId]);
useEffect(() => {
if (!noteId) return;
const note = db.notes?.note(noteId);
if (!note) return;
setTitle(note.title);
setDescription(note.headline);
}, [noteId]);
const repeatsDaily =
(selectedDays.length === 7 && recurringMode === RecurringModes.WEEK) ||
(selectedDays.length === 31 && recurringMode === RecurringModes.MONTH) ||