Skip to content

Commit 8d5c745

Browse files
committed
Electron optimization
1 parent 30cd5fd commit 8d5c745

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

frontend/src/electron/electron.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @version 1.0.0
66
*/
77

8-
export const isElectron = window.electronInterface != undefined;
8+
export const isElectron = import.meta.env.VITE_ELECTRON && window.electronInterface != undefined;
99

1010
if (isElectron) {
1111
console.log("Running in Electron");
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { PRODUCT_NAME } from "../../core/config";
2+
import { isElectron } from "../../electron/electron";
23

34
export function ElectronTitleBar() {
4-
if (window.electronInterface !== undefined) {
5-
return (
6-
<div id="electron-title-bar">
7-
{window.electronInterface.platform == "darwin" ? <div className="macos-padding"></div> : undefined}
8-
<div id="window-title">{PRODUCT_NAME}</div>
9-
</div>
10-
)
11-
}
5+
return isElectron && (
6+
<div id="electron-title-bar">
7+
{window.electronInterface.platform == "darwin" && <div className="macos-padding"></div>}
8+
<div id="window-title">{PRODUCT_NAME}</div>
9+
</div>
10+
)
1211
}

0 commit comments

Comments
 (0)