mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00
Update main.js
This commit is contained in:
parent
daead7a5f7
commit
770a7684da
@ -210,6 +210,16 @@ app.whenReady().then(() => {
|
||||
app.on("activate", () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow();
|
||||
});
|
||||
|
||||
// ✅ Windows: Handle file reopening while app is already running
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
app.quit();
|
||||
} else {
|
||||
app.on("second-instance", (event, argv) => {
|
||||
const fileArg = argv.find(arg => arg.startsWith("C:\\") || arg.startsWith("/"));
|
||||
if (fileArg) openFileSafely(fileArg);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let hasOpenedFile = false;
|
||||
|
Loading…
Reference in New Issue
Block a user