Skip to content

Commit

Permalink
Fix: Set local file timestamp before broadcastFileWrite
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Feb 22, 2025
1 parent a597cf3 commit e286d99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/data/file_manager/file_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ class FileManager {
final File file = getFile(filePath);
await _createFileDirectory(filePath);
Future writeFuture = Future.wait([
file.writeAsBytes(toWrite),
file.writeAsBytes(toWrite).then((file) async {
if (lastModified != null) await file.setLastModified(lastModified);
}),
// if we're using a new format, also delete the old file
if (filePath.endsWith(Editor.extension))
getFile(
Expand All @@ -209,9 +211,6 @@ class FileManager {
]);

void afterWrite() {
if (lastModified != null) {
file.setLastModified(lastModified);
}
broadcastFileWrite(FileOperationType.write, filePath);
if (alsoUpload) syncer.uploader.enqueueRel(filePath);
if (filePath.endsWith(Editor.extension)) {
Expand Down

0 comments on commit e286d99

Please sign in to comment.