Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: disable `requestSingleInstanceLock` for mac app store build

Abdullah Atta27f26065f6a2
diff --git a/apps/web/desktop/electron.js b/apps/web/desktop/electron.js
index 9a2badd0a..41b0f058e 100644
--- a/apps/web/desktop/electron.js
+++ b/apps/web/desktop/electron.js
@@ -16,6 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* global MAC_APP_STORE */
require("isomorphic-fetch");
const { app, BrowserWindow, nativeTheme, shell } = require("electron");
@@ -40,7 +41,8 @@ try {
}
// only run a single instance
-if (!app.requestSingleInstanceLock()) {
+
+if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
app.exit();
}
diff --git a/apps/web/desktop/preload.js b/apps/web/desktop/preload.js
index eaa103587..04bcaecc1 100644
--- a/apps/web/desktop/preload.js
+++ b/apps/web/desktop/preload.js
@@ -16,13 +16,11 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* global MAC_APP_STORE */
const { contextBridge, ipcRenderer } = require("electron");
-let isMacAppStore =
- // eslint-disable-next-line no-undef
- process.env.NODE_ENV === "production" ? MAC_APP_STORE : false;
-contextBridge.exposeInMainWorld("os", isMacAppStore ? "mas" : process.platform);
+contextBridge.exposeInMainWorld("os", MAC_APP_STORE ? "mas" : process.platform);
// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object