Skip to content

Commit b54a07a

Browse files
authored
Merge pull request #22 from nrkno/fix/disable-in-config
fix: add disable option in config
2 parents a8bef36 + 1d7eaf3 commit b54a07a

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/helpers/AllWindowsManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export class AllWindowsManager extends EventEmitter {
6565
}
6666

6767
for (const [id, configWindow] of Object.entries<ConfigWindow>(config.windows)) {
68+
if (configWindow.disable) continue
69+
6870
removeWindowIds.delete(id)
6971

7072
const window = this.windowsHandlers[id]

src/helpers/ConfigHelper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ export class ConfigHelper extends EventEmitter {
127127
config.windows[windowId] = window
128128
}
129129
}
130+
131+
for (const window of Object.values<ConfigWindow>(config.windows)) {
132+
if (window.disable === undefined) window.disable = false
133+
}
130134
}
131135
/** Returns the path of the folder where we store the config file. */
132136
private get homePath(): string {

src/lib/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export interface ConfigWindow {
2222
/** Height of the window */
2323
height: number
2424

25+
disable: boolean
26+
2527
/** Set to true to make the window fullscreen */
2628
fullScreen: boolean
2729
/** Set to true make the window always-on-top */
@@ -61,6 +63,7 @@ export const DEFAULT_CONFIG: Config = {
6163
apiKey: '',
6264
windows: {
6365
default: {
66+
disable: false,
6467
x: undefined,
6568
y: undefined,
6669
width: 1280,

0 commit comments

Comments
 (0)