mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-18 06:39:44 +00:00
Update main.js
1.0.6
This commit is contained in:
parent
12a0c892f0
commit
54a93033f8
@ -206,7 +206,7 @@ app.whenReady().then(() => {
|
|||||||
openFileSafely(filePath);
|
openFileSafely(filePath);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
if (["win32", "linux"].includes(process.platform)) {
|
||||||
if (!app.requestSingleInstanceLock()) {
|
if (!app.requestSingleInstanceLock()) {
|
||||||
app.quit();
|
app.quit();
|
||||||
} else {
|
} else {
|
||||||
@ -225,10 +225,8 @@ function openFileSafely(filePath) {
|
|||||||
hasOpenedFile = true;
|
hasOpenedFile = true;
|
||||||
|
|
||||||
if (mainWindow?.webContents) {
|
if (mainWindow?.webContents) {
|
||||||
mainWindow.webContents.once("did-finish-load", () => {
|
|
||||||
const winFileURL = pathToFileURL(filePath).href; // ✅ Convert and encode file path
|
const winFileURL = pathToFileURL(filePath).href; // ✅ Convert and encode file path
|
||||||
mainWindow.webContents.send("play-media", winFileURL);
|
mainWindow.webContents.send("play-media", winFileURL);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => (hasOpenedFile = false), 1000);
|
setTimeout(() => (hasOpenedFile = false), 1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user