mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Ensure only one app instance (#1742)
* force only one app instance Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
da6c114b68
commit
2a7fc87134
@ -45,6 +45,16 @@ if (app.commandLine.getSwitchValue("proxy-server") !== "") {
|
|||||||
process.env.HTTPS_PROXY = app.commandLine.getSwitchValue("proxy-server");
|
process.env.HTTPS_PROXY = app.commandLine.getSwitchValue("proxy-server");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const instanceLock = app.requestSingleInstanceLock();
|
||||||
|
|
||||||
|
if (!instanceLock) {
|
||||||
|
app.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.on("second-instance", () => {
|
||||||
|
windowManager?.ensureMainWindow();
|
||||||
|
});
|
||||||
|
|
||||||
app.on("ready", async () => {
|
app.on("ready", async () => {
|
||||||
logger.info(`🚀 Starting Lens from "${workingDir}"`);
|
logger.info(`🚀 Starting Lens from "${workingDir}"`);
|
||||||
await shellSync();
|
await shellSync();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user