Skip to content

Commit

Permalink
Set To Do type on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Aug 31, 2023
1 parent b368dab commit 0104c01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/GrampsjsTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,13 @@ export class GrampsjsTask extends GrampsjsTranslateMixin(LitElement) {
_handleSaveNote() {
const editor = this.renderRoot.querySelector('grampsjs-editor')
const text = editor.data
const type = {_class: 'NoteType', string: 'To Do'}
if (this.source.note_list.length > 0) {
const note = this.source.extended.notes[0]
const data = {...note, text}
const data = {...note, text, type}
fireEvent(this, 'task:update-note-text', data)
} else {
const data = {text}
const data = {text, type}
if (text.string.trim() !== '') {
fireEvent(this, 'task:add-note-text', data)
}
Expand Down

0 comments on commit 0104c01

Please sign in to comment.