Skip to content

Commit a2a29c5

Browse files
fix: rename file before saving
1 parent a3c12f9 commit a2a29c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/pages/editor/editor.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ class EditorState extends State<Editor> {
831831
savingState.value = SavingState.saving;
832832
}
833833

834+
await _renameFileNow();
835+
834836
final filePath = coreInfo.filePath + Editor.extension;
835837
final Uint8List bson;
836838
final OrderedAssetCache assets;
@@ -919,7 +921,7 @@ class EditorState extends State<Editor> {
919921
final newName = filenameTextEditingController.text;
920922
if (newName == coreInfo.fileName) return;
921923

922-
if (_filenameFormKey.currentState?.validate() ?? false) {
924+
if (_filenameFormKey.currentState?.validate() != null) {
923925
coreInfo.filePath = await FileManager.moveFile(
924926
coreInfo.filePath + Editor.extension, newName + Editor.extension);
925927
coreInfo.filePath = coreInfo.filePath

0 commit comments

Comments
 (0)