You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Mobile: Fixes #393: Fixed moving new notes before they are saved
This commit is contained in:
@ -10,14 +10,16 @@ shared.noteExists = async function(noteId) {
|
||||
return !!existingNote;
|
||||
}
|
||||
|
||||
shared.saveNoteButton_press = async function(comp) {
|
||||
shared.saveNoteButton_press = async function(comp, folderId = null) {
|
||||
let note = Object.assign({}, comp.state.note);
|
||||
|
||||
// Note has been deleted while user was modifying it. In that case, we
|
||||
// just save a new note by clearing the note ID.
|
||||
if (note.id && !(await shared.noteExists(note.id))) delete note.id;
|
||||
|
||||
if (!note.parent_id) {
|
||||
if (folderId) {
|
||||
note.parent_id = folderId;
|
||||
} else if (!note.parent_id) {
|
||||
let folder = await Folder.defaultFolder();
|
||||
if (!folder) return;
|
||||
note.parent_id = folder.id;
|
||||
|
Reference in New Issue
Block a user