-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
483b91c
commit 7739607
Showing
10 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,44 @@ | ||
import { app, BrowserWindow } from 'electron'; | ||
import { createAppWindow } from './AppWindow'; | ||
// import log from 'electron-log'; | ||
|
||
if (require('electron-squirrel-startup')) { | ||
app.quit(); | ||
} | ||
|
||
app.on('ready', () => { | ||
createAppWindow(); | ||
}); | ||
|
||
app.on('activate', () => { | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createAppWindow(); | ||
var handleStartupEvent = () => { | ||
if (process.platform !== 'win32') { | ||
return false; | ||
} | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
var squirrelCommand = process.argv[1]; | ||
switch (squirrelCommand) { | ||
case '--squirrel-install': | ||
case '--squirrel-updated': | ||
setTimeout(app.quit, 2000); | ||
return true; | ||
case '--squirrel-uninstall': | ||
setTimeout(app.quit, 2000); | ||
return true; | ||
case '--squirrel-obsolete': | ||
setTimeout(app.quit, 2000); | ||
return true; | ||
} | ||
}); | ||
}; | ||
|
||
if (!handleStartupEvent()) { | ||
app.on('ready', () => { | ||
createAppWindow(); | ||
}); | ||
|
||
app.on('activate', () => { | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createAppWindow(); | ||
} | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import '@src/window/WindowPreload'; | ||
import './preload/config/ConfigPreload'; | ||
import './preload/keyboard/KeyboardPreload'; | ||
import './preload/log/LogPreload'; | ||
|
||
console.log('[CP] : Preload execution started'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import log from 'electron-log'; | ||
|
||
const electronLog = { | ||
log: log.functions, | ||
} | ||
|
||
export default electronLog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import electronLog from './ElectronLog'; | ||
import log from 'electron-log'; | ||
|
||
type AddedProps = { | ||
electron_log: typeof electronLog; | ||
} | ||
|
||
type CombinedWindow = typeof window & AddedProps; | ||
|
||
const context: typeof log.functions = (window as CombinedWindow).electron_log.log; | ||
|
||
export default context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { contextBridge } from 'electron'; | ||
import log from 'electron-log'; | ||
|
||
contextBridge.exposeInMainWorld('electron_log', { | ||
log: log.functions, | ||
}); |