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
desktop: fix ENOENT error when saving backup
Abdullah Atta6c19968ef695
diff --git a/apps/desktop/src/api/updater.ts b/apps/desktop/src/api/updater.tsindex 405318293..098122288 100644--- a/apps/desktop/src/api/updater.ts+++ b/apps/desktop/src/api/updater.ts@@ -75,6 +75,7 @@ function createSubscription<const listener: AppUpdaterEvents[TName] = (...args: any[]) => {emit.next(args[0]);};+ autoUpdater.removeAllListeners(eventName);autoUpdater.addListener(eventName, listener);return () => {autoUpdater.removeListener(eventName, listener);diff --git a/apps/web/src/common/desktop-bridge/index.desktop.ts b/apps/web/src/common/desktop-bridge/index.desktop.tsindex 7285b9106..6b6d0fdcb 100644--- a/apps/web/src/common/desktop-bridge/index.desktop.ts+++ b/apps/web/src/common/desktop-bridge/index.desktop.ts@@ -77,11 +77,14 @@ export async function createWritableStream(path: string) {filePath: path});if (!resolvedPath) throw new Error("invalid path.");- const fs = require("fs");+ const { mkdirSync, createWriteStream }: typeof import("fs") = require("fs");+ const { dirname }: typeof import("path") = require("path");const { Writable } = require("stream");++ mkdirSync(dirname(resolvedPath), { recursive: true });return new WritableStream(Writable.toWeb(- fs.createWriteStream(resolvedPath, { encoding: "utf-8" })+ createWriteStream(resolvedPath, { encoding: "utf-8" })).getWriter());}