1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Fixes #393: Fixed moving new notes before they are saved

This commit is contained in:
Laurent Cozic
2018-05-01 18:53:45 +01:00
parent 05faf55e8d
commit 398946d39a
2 changed files with 12 additions and 5 deletions

View File

@@ -186,8 +186,8 @@ class NoteScreenComponent extends BaseScreenComponent {
shared.noteComponent_change(this, 'body', text);
}
async saveNoteButton_press() {
await shared.saveNoteButton_press(this);
async saveNoteButton_press(folderId = null) {
await shared.saveNoteButton_press(this, folderId);
Keyboard.dismiss();
}
@@ -560,7 +560,12 @@ class NoteScreenComponent extends BaseScreenComponent {
enabled: true,
selectedFolderId: folder ? folder.id : null,
onValueChange: async (itemValue, itemIndex) => {
if (note.id) await Note.moveToFolder(note.id, itemValue);
if (!note.id) {
await this.saveNoteButton_press(itemValue);
} else {
await Note.moveToFolder(note.id, itemValue);
}
note.parent_id = itemValue;
const folder = await Folder.load(note.parent_id);