Skip to content

Commit

Permalink
fix: fix patch when no electron browserwindow option
Browse files Browse the repository at this point in the history
  • Loading branch information
subframe7536 committed Oct 20, 2024
1 parent 7be05af commit 3da9466
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/manager/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export class MainFileManager extends BaseFileManager {
}

patch(_fontChanged: boolean, content: () => string): Promisable<string | undefined> {
if (Object.keys(config.electron).length) {
return content().replace(
const js = content()
return Object.keys(config.electron || {}).length
? js.replace(
new RegExp(entry, 'g'),
`${JSON.stringify(config.electron).slice(1, -1)},${entry}`,
)
}
: js
}
}

0 comments on commit 3da9466

Please sign in to comment.