mirror of
https://github.com/litruv/AudioSort.git
synced 2026-07-24 02:36:01 +10:00
32 lines
714 B
TypeScript
32 lines
714 B
TypeScript
import { app } from 'electron';
|
|
import { MainApp } from './MainApp';
|
|
|
|
// Disable GPU acceleration on Linux to avoid graphics driver issues
|
|
if (process.platform === 'linux') {
|
|
app.disableHardwareAcceleration();
|
|
}
|
|
|
|
const mainApp = new MainApp();
|
|
|
|
app.whenReady()
|
|
.then(() => mainApp.initialize())
|
|
.catch((error: unknown) => {
|
|
console.error('Failed to initialise application', error);
|
|
app.quit();
|
|
});
|
|
|
|
app.on('window-all-closed', () => {
|
|
const processRef = (globalThis as { process?: { platform?: string } }).process;
|
|
if (processRef?.platform !== 'darwin') {
|
|
app.quit();
|
|
}
|
|
});
|
|
|
|
app.on('activate', () => {
|
|
mainApp.ensureWindow();
|
|
});
|
|
|
|
app.on('before-quit', () => {
|
|
mainApp.dispose();
|
|
});
|