mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 16:46:51 +08:00
Folder rename: Only udpate 'folderPath' once rename is successfull
This commit is contained in:
@ -268,8 +268,8 @@ class NotesFolder with ChangeNotifier implements Comparable<NotesFolder> {
|
|||||||
void rename(String newName) {
|
void rename(String newName) {
|
||||||
var dir = Directory(folderPath);
|
var dir = Directory(folderPath);
|
||||||
var parentDirName = dirname(folderPath);
|
var parentDirName = dirname(folderPath);
|
||||||
folderPath = p.join(parentDirName, newName);
|
|
||||||
dir.renameSync(folderPath);
|
dir.renameSync(folderPath);
|
||||||
|
folderPath = p.join(parentDirName, newName);
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user