mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:39:01 +01:00 
			
		
		
		
	fix(react/dialogs): delete notes not properly reporting state
This commit is contained in:
		
							parent
							
								
									5cd7e4707a
								
							
						
					
					
						commit
						b25e9cdee6
					
				| @ -58,7 +58,7 @@ function DeleteNotesDialogComponent() { | |||||||
|             setBrokenRelations(response.brokenRelations); |             setBrokenRelations(response.brokenRelations); | ||||||
|             setNoteIdsToBeDeleted(response.noteIdsToBeDeleted); |             setNoteIdsToBeDeleted(response.noteIdsToBeDeleted); | ||||||
|         }); |         }); | ||||||
|     }, [ opts ]); |     }, [ opts, deleteAllClones ]); | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|         <Modal |         <Modal | ||||||
| @ -113,6 +113,7 @@ function DeletedNotes({ noteIdsToBeDeleted }: { noteIdsToBeDeleted: DeleteNotesP | |||||||
|         }); |         }); | ||||||
|     }, [noteIdsToBeDeleted]); |     }, [noteIdsToBeDeleted]); | ||||||
| 
 | 
 | ||||||
|  |     if (noteIdsToBeDeleted.length) { | ||||||
|         return ( |         return ( | ||||||
|             <div className="delete-notes-list-wrapper"> |             <div className="delete-notes-list-wrapper"> | ||||||
|                 <h4>{t("delete_notes.notes_to_be_deleted", { notesCount: noteIdsToBeDeleted.length })}</h4> |                 <h4>{t("delete_notes.notes_to_be_deleted", { notesCount: noteIdsToBeDeleted.length })}</h4> | ||||||
| @ -124,6 +125,13 @@ function DeletedNotes({ noteIdsToBeDeleted }: { noteIdsToBeDeleted: DeleteNotesP | |||||||
|                 </ul> |                 </ul> | ||||||
|             </div> |             </div> | ||||||
|         ); |         ); | ||||||
|  |     } else { | ||||||
|  |         return ( | ||||||
|  |             <Alert type="info"> | ||||||
|  |                 {t("delete_notes.no_note_to_delete")} | ||||||
|  |             </Alert> | ||||||
|  |         ) | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function BrokenRelations({ brokenRelations }: { brokenRelations: DeleteNotesPreview["brokenRelations"] }) { | function BrokenRelations({ brokenRelations }: { brokenRelations: DeleteNotesPreview["brokenRelations"] }) { | ||||||
| @ -161,11 +169,7 @@ function BrokenRelations({ brokenRelations }: { brokenRelations: DeleteNotesPrev | |||||||
|             </Alert> |             </Alert> | ||||||
|         ); |         ); | ||||||
|     } else { |     } else { | ||||||
|         return ( |         return <></>; | ||||||
|             <Alert type="info"> |  | ||||||
|                 {t("delete_notes.no_note_to_delete")} |  | ||||||
|             </Alert> |  | ||||||
|         ); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran