mirror of https://github.com/gmbrax/Pilgrim.git
				
				
				
			Compare commits
	
		
			No commits in common. "2983be09b609b82e152bed39f480535bbe2d79c0" and "8e04c5b3c7a255fdd5298e11951147c3f95a5a19" have entirely different histories.
		
	
	
		
			2983be09b6
			...
			8e04c5b3c7
		
	
		| 
						 | 
					@ -913,22 +913,11 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
                self.notify("Empty entry cannot be saved")
 | 
					                self.notify("Empty entry cannot be saved")
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
            # Passe a lista de fotos para o método de criação
 | 
					            # Passe a lista de fotos para o método de criação
 | 
				
			||||||
            if self.new_entry_title == "":
 | 
					            self.call_later(self._async_create_entry, content, photos_to_link)
 | 
				
			||||||
               self.app.push_screen(RenameEntryModal(current_name=""), lambda result: self._handle_save_after_rename(result,content,
 | 
					 | 
				
			||||||
                                                                                               photos_to_link))
 | 
					 | 
				
			||||||
            else:
 | 
					 | 
				
			||||||
                self.call_later(self._async_create_entry, content, photos_to_link)
 | 
					 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            # Passe a lista de fotos para o método de atualização
 | 
					            # Passe a lista de fotos para o método de atualização
 | 
				
			||||||
            self.call_later(self._async_update_entry, content, photos_to_link)
 | 
					            self.call_later(self._async_update_entry, content, photos_to_link)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _handle_save_after_rename(self, result: str | None, content: str, photos_to_link: List[Photo]) -> None:
 | 
					 | 
				
			||||||
        if result is None:
 | 
					 | 
				
			||||||
            self.notify("Save cancelled")
 | 
					 | 
				
			||||||
            return
 | 
					 | 
				
			||||||
        self.new_entry_title = result
 | 
					 | 
				
			||||||
        self.call_later(self._async_create_entry, content, photos_to_link)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async def _async_create_entry(self, content: str, photos_to_link: List[Photo]):
 | 
					    async def _async_create_entry(self, content: str, photos_to_link: List[Photo]):
 | 
				
			||||||
        """Creates a new entry and links the referenced photos."""
 | 
					        """Creates a new entry and links the referenced photos."""
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
| 
						 | 
					@ -955,7 +944,7 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
                self.is_new_entry = False
 | 
					                self.is_new_entry = False
 | 
				
			||||||
                self.has_unsaved_changes = False
 | 
					                self.has_unsaved_changes = False
 | 
				
			||||||
                self._original_content = new_entry.text
 | 
					                self._original_content = new_entry.text
 | 
				
			||||||
                self.new_entry_title = ""
 | 
					                self.new_entry_title = "New Entry"
 | 
				
			||||||
                self.next_entry_id = max(entry.id for entry in self.entries) + 1
 | 
					                self.next_entry_id = max(entry.id for entry in self.entries) + 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                self._update_entry_display()
 | 
					                self._update_entry_display()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue