处理单实例
This commit is contained in:
parent
f847591814
commit
78214be4be
5
main.js
5
main.js
|
|
@ -118,13 +118,12 @@ function createNotification(user) {
|
|||
}
|
||||
|
||||
// 处理单实例
|
||||
app.makeSingleInstance((commandLine, workingDirectory) => {
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
app.on('session-created', (session) => {
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore();
|
||||
mainWindow.focus();
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
app.on('ready', () => {
|
||||
const env = process.argv.find((arg) => arg.startsWith('--env='))?.split('=')[1];
|
||||
|
|
|
|||
Loading…
Reference in New Issue