Skip to content

Commit

Permalink
squashing commits before rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kaganrua committed Jul 9, 2024
1 parent 6f60f58 commit 8890732
Show file tree
Hide file tree
Showing 15 changed files with 1,153 additions and 10 deletions.
21 changes: 20 additions & 1 deletion frontend/electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { release } from 'node:os';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import "../../polyfill/crypto";
import { startExpressServer } from "../../server/express.mjs";
import { gracefullyStopAnvil, startExpressServer } from "../../server/express.mjs";
import { update } from './update';
import sourcemap from 'source-map-support';

Expand Down Expand Up @@ -44,6 +44,16 @@ if (targetIndex !== -1) {
process.env.VITE_ZETAFORGE_IS_DEV = 'False'
}

const isPip = '--is_pip'

const targetPipIndex = process.argv.indexOf(isPip)

if(targetPipIndex !== -1) {
process.env.VITE_IS_PIP = 'True'
} else {
process.env.VITE_IS_PIP = 'False'
}

// Disable GPU Acceleration for Windows 7
if (release().startsWith('6.1')) app.disableHardwareAcceleration()

Expand All @@ -66,6 +76,7 @@ const preload = join(__dirname, '../preload/index.mjs')
const url = process.env.VITE_DEV_SERVER_URL
const indexHtml = join(process.env.DIST, 'index.html')


const isMac = process.platform === 'darwin'
const menuTemplate: Electron.MenuItemConstructorOptions[] = [
...(isMac?
Expand Down Expand Up @@ -161,10 +172,16 @@ async function createWindow() {
app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
console.log("WINDOW ALL CLOSED!!!!")
win = null
if (process.platform !== 'darwin') app.quit()
})

app.on('will-quit', () => {
console.log("QUITTING ANVIL...")
gracefullyStopAnvil()
})

app.on('second-instance', () => {
if (win) {
// Focus on the main window if the user tried to open another
Expand All @@ -177,8 +194,10 @@ app.on('activate', () => {
const allWindows = BrowserWindow.getAllWindows()
if (allWindows.length) {
allWindows[0].focus()
allWindows[0].webContents.send('missing-config')
} else {
createWindow()
win?.webContents.send('missing-config')
}
})

Expand Down
Loading

0 comments on commit 8890732

Please sign in to comment.