A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: delete file before reuploading
Abdullah Atta8e207d787d30
diff --git a/apps/web/src/components/editor/picker.ts b/apps/web/src/components/editor/picker.tsindex b9e61a686..5ee058c95 100644--- a/apps/web/src/components/editor/picker.ts+++ b/apps/web/src/components/editor/picker.ts@@ -193,13 +193,17 @@ async function addAttachment(}if (forceWrite || !exists) {+ if (forceWrite && exists) {+ if (!(await db.fs().deleteFile(hash, false)))+ throw new Error("Failed to delete attachment from server.");+ await db.attachments.reset(exists.id);+ }+const key: SerializedKey = await getEncryptionKey();const output = await writeEncryptedFile(file, key, hash);if (!output) throw new Error("Could not encrypt file.");- if (forceWrite && exists) await db.attachments.reset(hash);-await db.attachments.add({...output,hash,