Return back writeAtomic for PDF reader setState #2210

This commit is contained in:
Martynas Bagdonas 2021-11-05 17:08:59 +02:00
parent f583416d80
commit b4cf566d0d
2 changed files with 4 additions and 2 deletions

View file

@ -300,7 +300,9 @@ class ReaderInstance {
await Zotero.Attachments.createDirectoryForItem(item);
}
file.append(this.pdfStateFileName);
await Zotero.File.putContentsAsync(file.path, JSON.stringify(state));
// Using `writeAtomic` instead of `putContentsAsync` to avoid
// using temp file that causes conflicts on simultaneous writes (on slow systems)
await OS.File.writeAtomic(file.path, JSON.stringify(state));
}
}

@ -1 +1 @@
Subproject commit a12714e8b6e75daf9408193930c0774d2a3b94a1
Subproject commit 74b8a7f9d3c3040636b7fb4542752d18cd695956