Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit da63554

Browse files
authored
Update titlebar.ts
1 parent 9d2a7c7 commit da63554

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/titlebar.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { Menubar } from './menubar';
1616
import { TitlebarOptions } from './interfaces';
1717
import styles from './styles/titlebar.scss';
1818
import defaultIcons from './styles/icons.json';
19-
import fs from 'fs';
2019

2120
const INACTIVE_FOREGROUND_DARK = Color.fromHex('#222222');
2221
const ACTIVE_FOREGROUND_DARK = Color.fromHex('#333333');
@@ -68,8 +67,7 @@ export default class Titlebar {
6867
constructor(titlebarOptions?: TitlebarOptions) {
6968
this.options = { ...this.defaultOptions, ...titlebarOptions };
7069
if (this.options.icons) {
71-
const icons = fs.readFileSync(this.options.icons, 'utf8');
72-
const jsonIcons = JSON.parse(icons);
70+
const jsonIcons = this.options.icons;
7371
this.platformIcons = jsonIcons[isWindows ? 'win' : isLinux ? 'linux' : 'mac'];
7472
} else {
7573
this.platformIcons = defaultIcons[isWindows ? 'win' : isLinux ? 'linux' : 'mac'];
@@ -534,4 +532,4 @@ export default class Titlebar {
534532

535533
removeNode(this.container);
536534
}
537-
}
535+
}

0 commit comments

Comments
 (0)