note edit: do not rename if new name didn't change

master
EmaMaker 2021-09-21 22:26:33 +02:00
parent 2dc121ec49
commit f70d7e8e7f
1 changed files with 6 additions and 5 deletions

View File

@ -110,13 +110,14 @@ class _NewNoteState extends State<NewNote> {
if (_controller.text != "") {
setState(() {
Navigator.pop(context);
print(_title);
//Note: code repetition
_changed = false;
widget.storage.saveRename(_title, _controllerNote.text, _controller.text);
_title = _controller.text;
if(_title != _controller.text){
_changed = false;
widget.storage.saveRename(_title, _controllerNote.text, _controller.text);
_title = _controller.text;
_controller.text = "";
_controller.text = "";
}
});
}
},