Skip to content

Commit a1f5491

Browse files
fix: validate name after dispose (#1213)
1 parent 60e08d4 commit a1f5491

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/pages/editor/editor.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ class EditorState extends State<Editor> {
879879
savingState.value = SavingState.saving;
880880
}
881881

882+
await _renameFileNow();
883+
882884
final filePath = coreInfo.filePath + Editor.extension;
883885
final Uint8List bson;
884886
final OrderedAssetCache assets;
@@ -967,7 +969,8 @@ class EditorState extends State<Editor> {
967969
final newName = filenameTextEditingController.text;
968970
if (newName == coreInfo.fileName) return;
969971

970-
if (_filenameFormKey.currentState?.validate() ?? true) {
972+
if (_filenameFormKey.currentState?.validate() ??
973+
_validateFilenameTextField(newName) == null) {
971974
coreInfo.filePath = await FileManager.moveFile(
972975
coreInfo.filePath + Editor.extension,
973976
newName.trim() + Editor.extension,

0 commit comments

Comments
 (0)