Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup platform checks. Remove old code. #3477

Merged
merged 8 commits into from
Jan 29, 2024
Next Next commit
Cleanup platform checks in main.ts
  • Loading branch information
arielj committed Jan 28, 2024
commit e9cf8b37a62a2ee62d4a87e857fdfa9f634fa20e
13 changes: 6 additions & 7 deletions src/backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from 'electron'
import 'backend/updater'
import { autoUpdater } from 'electron-updater'
import { cpus, platform } from 'os'
import { cpus } from 'os'
import {
access,
constants,
Expand Down Expand Up @@ -94,7 +94,9 @@ import {
createNecessaryFolders,
fixAsarPath,
isSnap,
fixesPath
fixesPath,
isWindows,
isMac
} from './constants'
import { handleProtocol } from './protocol'
import {
Expand Down Expand Up @@ -160,7 +162,6 @@ import { storeMap } from 'common/utils'
app.commandLine?.appendSwitch('ozone-platform-hint', 'auto')

const { showOpenDialog } = dialog
const isWindows = platform() === 'win32'

async function initializeWindow(): Promise<BrowserWindow> {
createNecessaryFolders()
Expand Down Expand Up @@ -234,9 +235,7 @@ async function initializeWindow(): Promise<BrowserWindow> {
handleExit()
})

if (isWindows) {
detectVCRedist(mainWindow)
}
detectVCRedist(mainWindow)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detectVCRedist already checks if isWindows inside the function


if (process.env.VITE_DEV_SERVER_URL) {
if (!process.env.HEROIC_NO_REACT_DEVTOOLS) {
Expand Down Expand Up @@ -637,7 +636,7 @@ ipcMain.on('quit', async () => handleExit())
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
if (!isMac) {
app.quit()
}
})
Expand Down