Skip to content

Commit

Permalink
Fixed env type hack (chaiNNer-org#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed May 31, 2022
1 parent b1bb5d0 commit 10367b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"types": ["electron"]
}
}
4 changes: 1 addition & 3 deletions src/common/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ import os from 'os';
export const isMac = process.platform === 'darwin';
export const isM1 = isMac && (os.cpus()[0]?.model.includes('Apple M1') ?? false);

export const isRenderer =
typeof process !== 'undefined' &&
(process as unknown as { type: 'browser' | 'renderer' | 'worker' }).type === 'renderer';
export const isRenderer = typeof process !== 'undefined' && process.type === 'renderer';

0 comments on commit 10367b9

Please sign in to comment.