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: check file size when checking for file existence
Abdullah Atta3b6fde2ea6e9
diff --git a/apps/web/src/interfaces/fs.ts b/apps/web/src/interfaces/fs.tsindex 34be135a7..90196dd91 100644--- a/apps/web/src/interfaces/fs.ts+++ b/apps/web/src/interfaces/fs.ts@@ -504,8 +504,12 @@ async function downloadFile(filename: string, requestOptions: RequestOptions) {}}-function exists(filename: string) {- return streamablefs.exists(filename);+async function exists(filename: string) {+ const handle = await streamablefs.readFile(filename);+ return (+ handle &&+ handle.file.size === (await handle.size()) - handle.file.chunks * ABYTES+ );}type FileMetadata = {