Skip to content

Commit

Permalink
fix: validate name after dispose (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebraVogel94349 authored Nov 10, 2024
1 parent 60e08d4 commit a1f5491
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pages/editor/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,8 @@ class EditorState extends State<Editor> {
savingState.value = SavingState.saving;
}

await _renameFileNow();

final filePath = coreInfo.filePath + Editor.extension;
final Uint8List bson;
final OrderedAssetCache assets;
Expand Down Expand Up @@ -967,7 +969,8 @@ class EditorState extends State<Editor> {
final newName = filenameTextEditingController.text;
if (newName == coreInfo.fileName) return;

if (_filenameFormKey.currentState?.validate() ?? true) {
if (_filenameFormKey.currentState?.validate() ??
_validateFilenameTextField(newName) == null) {
coreInfo.filePath = await FileManager.moveFile(
coreInfo.filePath + Editor.extension,
newName.trim() + Editor.extension,
Expand Down

0 comments on commit a1f5491

Please sign in to comment.