Skip to content

Commit

Permalink
Merge pull request #22 from nrkno/fix/disable-in-config
Browse files Browse the repository at this point in the history
fix: add disable option in config
  • Loading branch information
nytamin authored Feb 3, 2025
2 parents a8bef36 + 1d7eaf3 commit b54a07a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/helpers/AllWindowsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class AllWindowsManager extends EventEmitter {
}

for (const [id, configWindow] of Object.entries<ConfigWindow>(config.windows)) {
if (configWindow.disable) continue

removeWindowIds.delete(id)

const window = this.windowsHandlers[id]
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/ConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export class ConfigHelper extends EventEmitter {
config.windows[windowId] = window
}
}

for (const window of Object.values<ConfigWindow>(config.windows)) {
if (window.disable === undefined) window.disable = false
}
}
/** Returns the path of the folder where we store the config file. */
private get homePath(): string {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface ConfigWindow {
/** Height of the window */
height: number

disable: boolean

/** Set to true to make the window fullscreen */
fullScreen: boolean
/** Set to true make the window always-on-top */
Expand Down Expand Up @@ -61,6 +63,7 @@ export const DEFAULT_CONFIG: Config = {
apiKey: '',
windows: {
default: {
disable: false,
x: undefined,
y: undefined,
width: 1280,
Expand Down

0 comments on commit b54a07a

Please sign in to comment.