win.once() instead of win.on

This commit is contained in:
Araxeus
2021-04-23 04:06:54 +03:00
parent 72716afcd3
commit a194046168
4 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ module.exports.fileExists = (path, callbackIfExists) => {
};
module.exports.injectCSS = (webContents, filepath, cb = undefined) => {
webContents.on("did-finish-load", async () => {
webContents.once("did-finish-load", async () => {
await webContents.insertCSS(fs.readFileSync(filepath, "utf8"));
if (cb) {
cb();