forked from sheetjs/docs.sheetjs.com
chore: [Electron Demo] - remove unicode emoji in code comments.
This commit is contained in:
parent
d1efa326f6
commit
d35203cb2b
@ -26,7 +26,7 @@ function firstSpreadsheetFromArgv() {
|
||||
return args.find(a => EXT_REGEX.test(a)); // undefined if none
|
||||
}
|
||||
|
||||
/* ---- 1️⃣ single-instance guard (needed for Windows / Linux) ---- */
|
||||
/* ---- single-instance guard (needed for Windows / Linux) ---- */
|
||||
// on windows and linux, opening a file opens a new instance of the app, this prevents that.
|
||||
const gotLock = app.requestSingleInstanceLock();
|
||||
if (!gotLock) app.quit();
|
||||
@ -38,7 +38,7 @@ else {
|
||||
});
|
||||
}
|
||||
|
||||
/* ---- 2️⃣ platform-specific “open file” hooks ---- */
|
||||
/* ---- platform-specific “open file” hooks ---- */
|
||||
app.on('open-file', (event, fp) => { // macOS Dock / Finder
|
||||
event.preventDefault();
|
||||
sendToRenderer(fp);
|
||||
@ -49,14 +49,14 @@ app.on('open-url', (event, url) => { // you can add a cu
|
||||
sendToRenderer(url.replace('file://', '')); // crude, adjust if you keep deep-links
|
||||
});
|
||||
|
||||
/* ---- 3️⃣ normal start-up, harvest argv ---- */
|
||||
/* ---- normal start-up, harvest argv ---- */
|
||||
app.whenReady().then(() => {
|
||||
const fp = firstSpreadsheetFromArgv(); // Windows & Linux first launch
|
||||
if (fp) pendingPaths.push(fp);
|
||||
createWindow();
|
||||
});
|
||||
|
||||
/* ---- 4️⃣ create the window ---- */
|
||||
/* ---- create the window ---- */
|
||||
function createWindow() {
|
||||
if (win) return;
|
||||
win = new electron.BrowserWindow({
|
||||
|
Loading…
Reference in New Issue
Block a user