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 "object has been destoryed" error
Abdullah Attaeb35d413210a
diff --git a/apps/desktop/package-lock.json b/apps/desktop/package-lock.jsonindex 00deacf78..897f8739d 100644--- a/apps/desktop/package-lock.json+++ b/apps/desktop/package-lock.json@@ -12,7 +12,7 @@"@trpc/client": "^10.29.1","@trpc/server": "^10.29.1","diary": "^0.3.1",- "electron-trpc": "^0.5.0",+ "electron-trpc": "^0.5.2","electron-updater": "^5.3.0","icojs": "^0.17.1","typed-emitter": "^2.1.0",diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 52bcb1087..7b13f2e2e 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -15,7 +15,7 @@"@trpc/client": "^10.29.1","@trpc/server": "^10.29.1","diary": "^0.3.1",- "electron-trpc": "^0.5.0",+ "electron-trpc": "^0.5.2","electron-updater": "^5.3.0","icojs": "^0.17.1","typed-emitter": "^2.1.0",diff --git a/apps/desktop/patches/electron-trpc+0.5.2.patch b/apps/desktop/patches/electron-trpc+0.5.2.patchnew file mode 100644index 000000000..d00fa3f35--- /dev/null+++ b/apps/desktop/patches/electron-trpc+0.5.2.patch@@ -0,0 +1,23 @@+diff --git a/node_modules/electron-trpc/dist/main.mjs b/node_modules/electron-trpc/dist/main.mjs+index 379cf3b..2644e5d 100644+--- a/node_modules/electron-trpc/dist/main.mjs++++ b/node_modules/electron-trpc/dist/main.mjs+@@ -221,9 +221,16 @@ class G {+ i(this, c).includes(r) || (i(this, c).push(r), I(this, T, W).call(this, r));+ }+ detachWindow(r) {+++ y(this, c, i(this, c).filter((n) => n !== r));+- for (const [n, t] of i(this, u).entries())+- n.startsWith(`${r.webContents.id}-`) && (t.unsubscribe(), i(this, u).delete(n));++ for (const [n, t] of i(this, u).entries()) {++ try {++ n.startsWith(`${r.webContents.id}-`) && (t.unsubscribe(), i(this, u).delete(n));++ } catch(e) {++ console.error(e);++ // ignore++ }++ }+ }+ }+ c = new WeakMap(), u = new WeakMap(), T = new WeakSet(), W = function(r) {