From 15f873328055fcd58470b73e55b3a75d9943ca21 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 2 Apr 2025 13:40:50 -0700 Subject: [PATCH] Add auto login only on production build. --- .circleci/config.yml | 2 +- .env.production | 2 +- src/main/index.ts | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d159db4..25c23e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ jobs: workflows: deploy_and_build: jobs: - - partner-win-build + - partner-win-build: filters: branches: only: main diff --git a/.env.production b/.env.production index d300fbc..f7dd5a7 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDomain":"imex-prod.firebaseapp.com","databaseURL":"https://imex-prod.firebaseio.com","projectId":"imex-prod","storageBucket":"imex-prod.appspot.com","messagingSenderId":"253497221485","appId":"1:253497221485:web:3c81c483b94db84b227a64","measurementId":"G-NTWBKG2L0M"} -VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql \ No newline at end of file +VITE_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql \ No newline at end of file diff --git a/src/main/index.ts b/src/main/index.ts index 465ae04..6b43085 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -130,10 +130,12 @@ function createWindow(): void { const currentSetting = store.get("app.openOnStartup") as boolean; store.set("app.openOnStartup", !currentSetting); log.info("Open on startup set to", !currentSetting); - app.setLoginItemSettings({ - enabled: true, //This is a windows only command. Updates the task manager and registry. - openAtLogin: !currentSetting, - }); + if (!import.meta.env.DEV) { + app.setLoginItemSettings({ + enabled: true, //This is a windows only command. Updates the task manager and registry. + openAtLogin: !currentSetting, + }); + } }, }, ], @@ -380,10 +382,12 @@ app.on("before-quit", () => { const currentSetting = store.get("app.openOnStartup") as boolean; store.set("app.openOnStartup", !currentSetting); log.info("Open on startup set to", !currentSetting); - app.setLoginItemSettings({ - enabled: true, //This is a windows only command. Updates the task manager and registry. - openAtLogin: !currentSetting, - }); + if (!import.meta.env.DEV) { + app.setLoginItemSettings({ + enabled: true, //This is a windows only command. Updates the task manager and registry. + openAtLogin: !currentSetting, + }); + } isAppQuitting = true; });