Folder rename: Only udpate 'folderPath' once rename is successfull

This commit is contained in:
Vishesh Handa
2019-12-27 00:37:26 +01:00
parent 8a6b6023d6
commit 046c08cb67

View File

@ -268,8 +268,8 @@ class NotesFolder with ChangeNotifier implements Comparable<NotesFolder> {
void rename(String newName) {
var dir = Directory(folderPath);
var parentDirName = dirname(folderPath);
folderPath = p.join(parentDirName, newName);
dir.renameSync(folderPath);
folderPath = p.join(parentDirName, newName);
notifyListeners();
}