mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fix selecting note title after creation, closes #997
This commit is contained in:
		
							parent
							
								
									70e343f2fc
								
							
						
					
					
						commit
						3b268cc8eb
					
				@ -38,12 +38,6 @@ export default class MainTreeExecutors extends Component {
 | 
				
			|||||||
            isProtected: activeNote.isProtected,
 | 
					            isProtected: activeNote.isProtected,
 | 
				
			||||||
            saveSelection: false
 | 
					            saveSelection: false
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					 | 
				
			||||||
        await ws.waitForMaxKnownSyncId();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        appContext.tabManager.getActiveTabContext().setNote(note.noteId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        appContext.triggerCommand('focusAndSelectTitle');
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async createNoteAfterCommand() {
 | 
					    async createNoteAfterCommand() {
 | 
				
			||||||
@ -55,17 +49,11 @@ export default class MainTreeExecutors extends Component {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const {note} = await noteCreateService.createNote(parentNoteId, {
 | 
					        await noteCreateService.createNote(parentNoteId, {
 | 
				
			||||||
            target: 'after',
 | 
					            target: 'after',
 | 
				
			||||||
            targetBranchId: node.data.branchId,
 | 
					            targetBranchId: node.data.branchId,
 | 
				
			||||||
            isProtected: isProtected,
 | 
					            isProtected: isProtected,
 | 
				
			||||||
            saveSelection: true
 | 
					            saveSelection: false
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					 | 
				
			||||||
        await ws.waitForMaxKnownSyncId();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        appContext.tabManager.getActiveTabContext().setNote(note.noteId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        appContext.triggerCommand('focusAndSelectTitle');
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -48,8 +48,12 @@ async function createNote(parentNoteId, options = {}) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (options.activate) {
 | 
					    if (options.activate) {
 | 
				
			||||||
 | 
					        await ws.waitForMaxKnownSyncId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const activeTabContext = appContext.tabManager.getActiveTabContext();
 | 
					        const activeTabContext = appContext.tabManager.getActiveTabContext();
 | 
				
			||||||
        activeTabContext.setNote(note.noteId);
 | 
					        await activeTabContext.setNote(note.noteId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        appContext.triggerCommand('focusAndSelectTitle');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return {note, branch};
 | 
					    return {note, branch};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user