From 3e3f65a18d75002b17b8a0149553d3143d8b5f8b Mon Sep 17 00:00:00 2001 From: Muffin Date: Mon, 31 Jul 2023 23:45:50 -0500 Subject: [PATCH] keepExistingData for firefox --- src/lib/tw-restore-point-api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/tw-restore-point-api.js b/src/lib/tw-restore-point-api.js index 250b71fa4b5..800b5f65b46 100644 --- a/src/lib/tw-restore-point-api.js +++ b/src/lib/tw-restore-point-api.js @@ -116,7 +116,10 @@ const writeFile = async (directory, filename, data) => { const fileHandle = await directory.getFileHandle(filename, { create: true }); - const writable = await fileHandle.createWritable(); + const writable = await fileHandle.createWritable({ + // TODO: Firefox seems to not do this by default? + keepExistingData: false + }); await writable.write(data); await writable.close(); };