Skip to content

Commit

Permalink
replace deprecated url.format with win.loadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
p-sam committed Sep 12, 2021
1 parent 0b2a119 commit 2bd19da
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const url = require('url');
const path = require('path');
const electron = require('electron');

Expand Down Expand Up @@ -138,14 +137,10 @@ function electronPrompt(options, parentWindow) {
resolve(null);
});

const promptUrl = url.format({
protocol: 'file',
slashes: true,
pathname: path.join(__dirname, 'page', 'prompt.html'),
hash: id,
});

promptWindow.loadURL(promptUrl);
promptWindow.loadFile(
path.join(__dirname, 'page', 'prompt.html'),
{hash: id},
);
});
}

Expand Down

0 comments on commit 2bd19da

Please sign in to comment.