1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Electron: Fixed auto-title when title is manually entered first

This commit is contained in:
Laurent Cozic 2018-01-30 21:36:54 +00:00
parent a4106436c4
commit 5b6019805c
2 changed files with 3 additions and 3 deletions

View File

@ -48,5 +48,4 @@ script:
- |
cd ElectronClient/app
rsync -aP --delete ../../ReactNativeClient/lib/ lib/
npm install
yarn dist
npm install && yarn dist

View File

@ -30,6 +30,7 @@ shared.saveNoteButton_press = async function(comp) {
options.fields = BaseModel.diffObjectsFields(comp.state.lastSavedNote, note);
}
const hasAutoTitle = comp.state.newAndNoTitleChangeNoteId || (isNew && !note.title);
if (hasAutoTitle) {
note.title = Note.defaultTitle(note);
@ -63,7 +64,7 @@ shared.saveNoteButton_press = async function(comp) {
note: note,
};
if (isNew) newState.newAndNoTitleChangeNoteId = note.id;
if (isNew && hasAutoTitle) newState.newAndNoTitleChangeNoteId = note.id;
comp.setState(newState);