Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function createMainWindow() {
isDev && await prepareNext('./renderer')
const window = new BrowserWindow()
isDev && window.webContents.openDevTools()
const url = isDev ? 'http://localhost:8000/home' : format({
pathname: path.join(__dirname, '../renderer/home/index.html'),
protocol: 'file',
slashes: true
})
window.loadURL(url)
window.on('closed', () => {
mainWindow = null
})
async function createMainWindow(): Promise {
isDev && await prepareNext('./renderer')
const window: BrowserWindow = new BrowserWindow()
isDev && window.webContents.openDevTools()
const url: string = isDev ? 'http://localhost:8000/home' : format({
pathname: path.join(__dirname, '../renderer/home/index.html'),
protocol: 'file',
slashes: true
})
window.loadURL(url)
window.on('closed', () => {
mainWindow = null
})