Skip to content

Commit

Permalink
fix: rename file before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebraVogel94349 committed Apr 7, 2024
1 parent a3c12f9 commit a2a29c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pages/editor/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,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 @@ -919,7 +921,7 @@ class EditorState extends State<Editor> {
final newName = filenameTextEditingController.text;
if (newName == coreInfo.fileName) return;

if (_filenameFormKey.currentState?.validate() ?? false) {
if (_filenameFormKey.currentState?.validate() != null) {
coreInfo.filePath = await FileManager.moveFile(
coreInfo.filePath + Editor.extension, newName + Editor.extension);
coreInfo.filePath = coreInfo.filePath
Expand Down

0 comments on commit a2a29c5

Please sign in to comment.