experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #21 from autonome/singlular

detect multiple instances and die

authored by

Dietrich Ayala and committed by
GitHub
eed1b63c 317bd2de

+17 -7
+1 -1
features/core/config.js
··· 20 20 "shortcutKey": { 21 21 "description": "App keyboard shortcut to load settings", 22 22 "type": "string", 23 - "default": "CommandOrControl+," 23 + "default": "CommandOrControl+Shift+," 24 24 }, 25 25 "height": { 26 26 "description": "User-set or -defined height of Settings page",
+3 -3
features/utils.js
··· 312 312 // TODO: fuckfuckfuck 313 313 // https://github.com/cocopon/tweakpane/issues/431 314 314 const exportPaneData = pane => { 315 - const val = pane.exportState(); 316 - /* 315 + //const val = pane.exportState(); 316 + // 317 317 const children = pane.rackApi_.children.filter(p => p.children); 318 318 const val = children.map(paneChild => { 319 319 return paneChild.children.reduce((obj, field) => { ··· 342 342 return obj; 343 343 }, {}); 344 344 }); 345 - */ 345 + // 346 346 return val; 347 347 }; 348 348
+13 -3
index.js
··· 40 40 const PROFILE = 41 41 profileIsLegit(process.env.PROFILE) 42 42 ? process.env.PROFILE 43 - : (DEBUG ? 'debug' : 'default'); 43 + : (DEBUG == true ? 'debug' : 'default'); 44 44 45 45 console.log('PROFILE', PROFILE); 46 46 ··· 200 200 const onReady = () => { 201 201 console.log('onReady'); 202 202 203 + //https://stackoverflow.com/questions/35916158/how-to-prevent-multiple-instances-in-electron 204 + const gotTheLock = app.requestSingleInstanceLock(); 205 + if (!gotTheLock) { 206 + console.error('APP INSTANCE ALREADY RUNNING, QUITTING'); 207 + app.quit(); 208 + return; 209 + } 210 + 203 211 // init web core 204 - openWindow({ 212 + const rootWin = openWindow({ 205 213 feature: 'Core', 206 214 file: webCoreAddress, 207 215 show: true, ··· 215 223 _prefs[msg.feature] = msg.prefs; 216 224 217 225 // show/hide in dock and tab switcher 218 - if (app.dock && (msg.prefs.showInDockAndSwitcher == false || !DEBUG)) { 226 + if (app.dock && msg.prefs.showInDockAndSwitcher == false) { 219 227 app.dock.hide(); 220 228 } 221 229 ··· 491 499 } 492 500 }); 493 501 } 502 + 503 + return win; 494 504 }; 495 505 496 506 /*