feat: bootstrap Electron desktop shell for Fabric frontend
This commit is contained in:
25
main.js
Normal file
25
main.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 840,
|
||||
webPreferences: {
|
||||
contextIsolation: true,
|
||||
},
|
||||
})
|
||||
|
||||
const url = process.env.FABRIC_DESKTOP_URL || 'file://' + __dirname + '/offline.html'
|
||||
win.loadURL(url)
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow()
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow()
|
||||
})
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit()
|
||||
})
|
||||
Reference in New Issue
Block a user