mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
NoteRename: Do it before trying to get the lock
Another operation coule be blocking git.
This commit is contained in:
@ -204,12 +204,12 @@ class StateContainer with ChangeNotifier {
|
||||
void renameNote(Note note, String newFileName) async {
|
||||
logEvent(Event.NoteRenamed);
|
||||
|
||||
var oldNotePath = note.filePath;
|
||||
note.rename(newFileName);
|
||||
|
||||
return _opLock.synchronized(() async {
|
||||
Log.d("Got renameNote lock");
|
||||
|
||||
var oldNotePath = note.filePath;
|
||||
note.rename(newFileName);
|
||||
|
||||
_gitRepo.renameNote(oldNotePath, note.filePath).then((NoteRepoResult _) {
|
||||
_syncNotes();
|
||||
appState.numChanges += 1;
|
||||
|
Reference in New Issue
Block a user