From 6af1020b7d4eb8dd388b16830e563bd1f7e87b24 Mon Sep 17 00:00:00 2001 From: Piotr Date: Wed, 31 May 2023 09:12:45 +0200 Subject: [PATCH] Enable i18next translations in popup window - bugfix --- app/electron/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/electron/main.js b/app/electron/main.js index b2a6136..e7bc9db 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -270,6 +270,11 @@ app.on("web-contents-created", (event, contents) => { contents.on("did-create-window", (window) => { i18nextBackend.mainBindings(ipcMain, window, fs); }); + // destroy bindings on popup window closed + contents.on("destroyed", () => { + i18nextBackend.clearMainBindings(ipcMain); + }); + // https://electronjs.org/docs/tutorial/security#13-disable-or-limit-creation-of-new-windows // This code replaces the old "new-window" event handling; // https://github.com/electron/electron/pull/24517#issue-447670981