mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	when single note is selected and it's the same that was right clicked for context menu, then we treat it as no-selection action
This commit is contained in:
		
							parent
							
								
									1e7586fae4
								
							
						
					
					
						commit
						c827d38f39
					
				@ -33,7 +33,13 @@ class TreeContextMenu {
 | 
				
			|||||||
        const parentNote = await treeCache.getNote(branch.parentNoteId);
 | 
					        const parentNote = await treeCache.getNote(branch.parentNoteId);
 | 
				
			||||||
        const isNotRoot = note.noteId !== 'root';
 | 
					        const isNotRoot = note.noteId !== 'root';
 | 
				
			||||||
        const isHoisted = note.noteId === await hoistedNoteService.getHoistedNoteId();
 | 
					        const isHoisted = note.noteId === await hoistedNoteService.getHoistedNoteId();
 | 
				
			||||||
        const noSelectedNotes = treeService.getSelectedNodes().length === 0;
 | 
					
 | 
				
			||||||
 | 
					        // some actions don't support multi-note so they are disabled when notes are selected
 | 
				
			||||||
 | 
					        // the only exception is when the only selected note is the one that was right-clicked, then
 | 
				
			||||||
 | 
					        // it's clear what the user meant to do.
 | 
				
			||||||
 | 
					        const selNodes = treeService.getSelectedNodes();
 | 
				
			||||||
 | 
					        const noSelectedNotes = selNodes.length === 0
 | 
				
			||||||
 | 
					                || (selNodes.length === 1 && selNodes[0] === this.node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNote.type !== 'search';
 | 
					        const insertNoteAfterEnabled = isNotRoot && !isHoisted && parentNote.type !== 'search';
 | 
				
			||||||
        const insertChildNoteEnabled = note.type !== 'search';
 | 
					        const insertChildNoteEnabled = note.type !== 'search';
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user