fix app quitting on linux, hide tray icon on linux as colors are inconsistent, fix multiplie instance spawning

This commit is contained in:
Gregor Vostrak
2024-08-28 14:17:01 +02:00
parent 5f6f38b83e
commit f6620eec50
5 changed files with 113 additions and 120 deletions
+89 -101
View File
@@ -1,12 +1,12 @@
{
"name": "solidtime",
"version": "0.0.31",
"version": "0.0.32",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "solidtime",
"version": "0.0.31",
"version": "0.0.32",
"hasInstallScript": true,
"dependencies": {
"@electron-toolkit/preload": "^3.0.0",
@@ -1822,9 +1822,9 @@
}
},
"node_modules/@opentelemetry/context-async-hooks": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.25.1.tgz",
"integrity": "sha512-UW/ge9zjvAEmRWVapOP0qyCvPulWU6cQxGxDbWEFfGOj1VBBZAuOqTo3X6yWmDTD3Xe15ysCZChHncr2xFMIfQ==",
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz",
"integrity": "sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
@@ -1834,12 +1834,12 @@
}
},
"node_modules/@opentelemetry/core": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz",
"integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==",
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz",
"integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/semantic-conventions": "1.25.1"
"@opentelemetry/semantic-conventions": "1.27.0"
},
"engines": {
"node": ">=14"
@@ -1848,15 +1848,6 @@
"@opentelemetry/api": ">=1.0.0 <1.10.0"
}
},
"node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz",
"integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
}
},
"node_modules/@opentelemetry/instrumentation": {
"version": "0.52.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz",
@@ -1995,6 +1986,21 @@
"@opentelemetry/api": "^1.3.0"
}
},
"node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/core": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz",
"integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/semantic-conventions": "1.25.1"
},
"engines": {
"node": ">=14"
},
"peerDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.10.0"
}
},
"node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/semantic-conventions": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz",
@@ -2168,13 +2174,13 @@
}
},
"node_modules/@opentelemetry/resources": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz",
"integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==",
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz",
"integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/core": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
"@opentelemetry/core": "1.26.0",
"@opentelemetry/semantic-conventions": "1.27.0"
},
"engines": {
"node": ">=14"
@@ -2183,24 +2189,14 @@
"@opentelemetry/api": ">=1.0.0 <1.10.0"
}
},
"node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz",
"integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
}
},
"node_modules/@opentelemetry/sdk-metrics": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz",
"integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==",
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz",
"integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/core": "1.25.1",
"@opentelemetry/resources": "1.25.1",
"lodash.merge": "^4.6.2"
"@opentelemetry/core": "1.26.0",
"@opentelemetry/resources": "1.26.0"
},
"engines": {
"node": ">=14"
@@ -2210,14 +2206,14 @@
}
},
"node_modules/@opentelemetry/sdk-trace-base": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz",
"integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==",
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz",
"integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/core": "1.25.1",
"@opentelemetry/resources": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
"@opentelemetry/core": "1.26.0",
"@opentelemetry/resources": "1.26.0",
"@opentelemetry/semantic-conventions": "1.27.0"
},
"engines": {
"node": ">=14"
@@ -2226,19 +2222,10 @@
"@opentelemetry/api": ">=1.0.0 <1.10.0"
}
},
"node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions": {
"version": "1.25.1",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz",
"integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
}
},
"node_modules/@opentelemetry/semantic-conventions": {
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.26.0.tgz",
"integrity": "sha512-U9PJlOswJPSgQVPI+XEuNLElyFWkb0hAiMg+DExD9V0St03X2lPHGMdxMY/LrVmoukuIpXJ12oyrOtEZ4uXFkw==",
"version": "1.27.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz",
"integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
@@ -2583,9 +2570,9 @@
}
},
"node_modules/@sentry/babel-plugin-component-annotate": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.2.tgz",
"integrity": "sha512-6kFAHGcs0npIC4HTt4ULs8uOfEucvMI7VW4hoyk17jhRaW8CbxzxfWCfIeRbDkE8pYwnARaq83tu025Hrk2zgA==",
"version": "2.22.3",
"resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.3.tgz",
"integrity": "sha512-OlHA+i+vnQHRIdry4glpiS/xTOtgjmpXOt6IBOUqynx5Jd/iK1+fj+t8CckqOx9wRacO/hru2wfW/jFq0iViLg==",
"license": "MIT",
"engines": {
"node": ">= 14"
@@ -2610,13 +2597,13 @@
}
},
"node_modules/@sentry/bundler-plugin-core": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.2.tgz",
"integrity": "sha512-TwEEW4FeEJ5Mamp4fGnktfVjzN77KAW0xFQsEPuxZtOAPG17zX/PGvdyRX/TE1jkZWhTzqUDIdgzqlNLjyEnUw==",
"version": "2.22.3",
"resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.3.tgz",
"integrity": "sha512-DeoUl0WffcqZZRl5Wy9aHvX4WfZbbWt0QbJ7NJrcEViq+dRAI2FQTYECFLwdZi5Gtb3oyqZICO+P7k8wDnzsjQ==",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.18.5",
"@sentry/babel-plugin-component-annotate": "2.22.2",
"@sentry/babel-plugin-component-annotate": "2.22.3",
"@sentry/cli": "^2.33.1",
"dotenv": "^16.3.1",
"find-up": "^5.0.0",
@@ -2629,9 +2616,9 @@
}
},
"node_modules/@sentry/cli": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.33.1.tgz",
"integrity": "sha512-dUlZ4EFh98VFRPJ+f6OW3JEYQ7VvqGNMa0AMcmvk07ePNeK/GicAWmSQE4ZfJTTl80ul6HZw1kY01fGQOQlVRA==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.34.0.tgz",
"integrity": "sha512-hS3MRtEOT1Y27ufBesTTg4xJx6Msf77U609ncy2u7z8uoTZgO8HNsq9DwuxitX5MTrREEJ+frCMFsYvwqkQcJw==",
"hasInstallScript": true,
"license": "BSD-3-Clause",
"dependencies": {
@@ -2648,19 +2635,19 @@
"node": ">= 10"
},
"optionalDependencies": {
"@sentry/cli-darwin": "2.33.1",
"@sentry/cli-linux-arm": "2.33.1",
"@sentry/cli-linux-arm64": "2.33.1",
"@sentry/cli-linux-i686": "2.33.1",
"@sentry/cli-linux-x64": "2.33.1",
"@sentry/cli-win32-i686": "2.33.1",
"@sentry/cli-win32-x64": "2.33.1"
"@sentry/cli-darwin": "2.34.0",
"@sentry/cli-linux-arm": "2.34.0",
"@sentry/cli-linux-arm64": "2.34.0",
"@sentry/cli-linux-i686": "2.34.0",
"@sentry/cli-linux-x64": "2.34.0",
"@sentry/cli-win32-i686": "2.34.0",
"@sentry/cli-win32-x64": "2.34.0"
}
},
"node_modules/@sentry/cli-darwin": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.33.1.tgz",
"integrity": "sha512-+4/VIx/E1L2hChj5nGf5MHyEPHUNHJ/HoG5RY+B+vyEutGily1c1+DM2bum7RbD0xs6wKLIyup5F02guzSzG8A==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.34.0.tgz",
"integrity": "sha512-mzQj58xxRej8uATdXgwHq3KZC2HhfGIyl+jVTh7nXzizOS5OsYZtShpGRxwfeC3eNZ6NqY7h0FWxJD6cUFgauA==",
"license": "BSD-3-Clause",
"optional": true,
"os": [
@@ -2671,9 +2658,9 @@
}
},
"node_modules/@sentry/cli-linux-arm": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.33.1.tgz",
"integrity": "sha512-zbxEvQju+tgNvzTOt635le4kS/Fbm2XC2RtYbCTs034Vb8xjrAxLnK0z1bQnStUV8BkeBHtsNVrG+NSQDym2wg==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.34.0.tgz",
"integrity": "sha512-FkNc22FOKU57h+s8ZkqTz/5Y+6GrCK2fSde2dntofOPJheBBuaYz7CDq0dEM9GuBCcvogQj8sf2hMb8+gdJrgA==",
"cpu": [
"arm"
],
@@ -2688,9 +2675,9 @@
}
},
"node_modules/@sentry/cli-linux-arm64": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.33.1.tgz",
"integrity": "sha512-DbGV56PRKOLsAZJX27Jt2uZ11QfQEMmWB4cIvxkKcFVE+LJP4MVA+MGGRUL6p+Bs1R9ZUuGbpKGtj0JiG6CoXw==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.34.0.tgz",
"integrity": "sha512-Sgl6b2BYI0uNB9WfJLkq4UZsOAXo35uwemtrXIJOz0zc9V4QIFwvmMYXAHpNVC3Z/dSU5PaWBJHEtUKouX5mOQ==",
"cpu": [
"arm64"
],
@@ -2705,9 +2692,9 @@
}
},
"node_modules/@sentry/cli-linux-i686": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.33.1.tgz",
"integrity": "sha512-g2LS4oPXkPWOfKWukKzYp4FnXVRRSwBxhuQ9eSw2peeb58ZIObr4YKGOA/8HJRGkooBJIKGaAR2mH2Pk1TKaiA==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.34.0.tgz",
"integrity": "sha512-W7QNzOsbhzsRY5deRsHCqJH4C/yNxwlX6b1JqBO1s7Zb0t5KhM3fFgZJ4DmLZMOvngnJ2wSuyDQCwTNPyEWsAw==",
"cpu": [
"x86",
"ia32"
@@ -2723,9 +2710,9 @@
}
},
"node_modules/@sentry/cli-linux-x64": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.33.1.tgz",
"integrity": "sha512-IV3dcYV/ZcvO+VGu9U6kuxSdbsV2kzxaBwWUQxtzxJ+cOa7J8Hn1t0koKGtU53JVZNBa06qJWIcqgl4/pCuKIg==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.34.0.tgz",
"integrity": "sha512-EJCzldxeNsEIgf5ASj0E9/6J5SwUVgtfoiOYjhBxj2e41jEDlh6o5uMNE4H+J2GX3zPFrN3LgsZYevgPqA35Mw==",
"cpu": [
"x64"
],
@@ -2740,9 +2727,9 @@
}
},
"node_modules/@sentry/cli-win32-i686": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.33.1.tgz",
"integrity": "sha512-F7cJySvkpzIu7fnLKNHYwBzZYYwlhoDbAUnaFX0UZCN+5DNp/5LwTp37a5TWOsmCaHMZT4i9IO4SIsnNw16/zQ==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.34.0.tgz",
"integrity": "sha512-bITy/IiT/y1MZhvKSt5UrBEDUNcOtQV20BZDyPriPijBcJ/1U69lgH3IM4bxIaTiicFnMdxbOlQhRSdm8SKURg==",
"cpu": [
"x86",
"ia32"
@@ -2757,9 +2744,9 @@
}
},
"node_modules/@sentry/cli-win32-x64": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.33.1.tgz",
"integrity": "sha512-8VyRoJqtb2uQ8/bFRKNuACYZt7r+Xx0k2wXRGTyH05lCjAiVIXn7DiS2BxHFty7M1QEWUCMNsb/UC/x/Cu2wuA==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.34.0.tgz",
"integrity": "sha512-wpP/w7Fhsr7+cbCgE/OI8hSh3pqESRpcdNgtBQjMuKN2FSE1E+GHrk5GB+fKZG2OAV4IN4HxE/z3NioAJeThfQ==",
"cpu": [
"x64"
],
@@ -2885,12 +2872,12 @@
}
},
"node_modules/@sentry/vite-plugin": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-2.22.2.tgz",
"integrity": "sha512-LJSNTw75UJq77v2jCan8cRh0w1u6W30jxQsbqF7YyyhhfjPTyFUXYday9RDDe84qDEnspbZmgeTSWTvaTGsBRg==",
"version": "2.22.3",
"resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-2.22.3.tgz",
"integrity": "sha512-+5bsLFRKOZzBp68XigoNE1pJ3tJ4gt2jXluApu54ui0N/yjfqGQ7LQTD7nL4tmJvB5Agwi0e7M7+fcxe9gSgBA==",
"license": "MIT",
"dependencies": {
"@sentry/bundler-plugin-core": "2.22.2",
"@sentry/bundler-plugin-core": "2.22.3",
"unplugin": "1.0.1"
},
"engines": {
@@ -3203,9 +3190,9 @@
}
},
"node_modules/@types/node": {
"version": "20.16.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.1.tgz",
"integrity": "sha512-zJDo7wEadFtSyNz5QITDfRcrhqDvQI1xQNQ0VoizPjM/dVAODqqIUWbJPkvsxmTI0MYRGRikcdjMPhOssnPejQ==",
"version": "20.16.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.2.tgz",
"integrity": "sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.2"
@@ -8342,6 +8329,7 @@
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"dev": true,
"license": "MIT"
},
"node_modules/lodash.union": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "solidtime",
"version": "0.0.31",
"version": "0.0.32",
"description": "Desktop App for solidtime - the modern open-source time tracker",
"main": "./out/main/index.js",
"author": "solidtime.io",
+10 -15
View File
@@ -2,21 +2,16 @@ import { app, BrowserWindow } from 'electron'
export function registerDeeplinkListeners(mainWindow: BrowserWindow) {
// handle linux and windows deeplinks
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (_, commandLine) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()
}
// the commandLine is array of strings in which last element is deep link url
mainWindow.webContents.send('openDeeplink', commandLine.pop())
})
}
app.on('second-instance', (_, commandLine) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.show()
mainWindow.focus()
}
// the commandLine is array of strings in which last element is deep link url
mainWindow.webContents.send('openDeeplink', commandLine.pop())
})
// handle mac os deeplinks
app.on('open-url', (_, url) => {
mainWindow.webContents.send('openDeeplink', url)
+9 -2
View File
@@ -11,6 +11,11 @@ import { registerVueDevTools } from './devtools'
import * as Sentry from '@sentry/electron/main'
import path from 'node:path'
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
}
initializeAutoUpdater()
Sentry.init({
@@ -37,8 +42,10 @@ function createWindow(): void {
const miniWindow = initializeMiniWindow(icon)
registerMiniWindowListeners(miniWindow)
const tray = initializeTray(mainWindow)
registerTrayListeners(tray, mainWindow)
if (process.platform !== 'linux') {
const tray = initializeTray(mainWindow)
registerTrayListeners(tray, mainWindow)
}
// HMR for renderer base on electron-vite cli.
// Load the remote URL for development or the local html file for production.
+4 -1
View File
@@ -25,10 +25,13 @@ export function initializeMainWindow(icon: string) {
let forcequit = false
mainWindow.on('close', (event) => {
if (forcequit === false) {
if (forcequit === false && process.platform === 'darwin') {
event.preventDefault()
mainWindow.hide()
}
if (process.platform === 'linux') {
app.quit()
}
})
app.on('before-quit', () => {
forcequit = true