Skip to content

Commit

Permalink
Readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
theogravity committed Mar 21, 2024
1 parent 841e5eb commit 661baac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.1 (2024-03-21)

Readme updates

# 1.0.0 (2024-03-20)

Initial version
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ ipcMain.handle('download-file', async (event, args) => {
const { url } = args;

let downloadId
const browserWindow = BrowserWindow.fromId(event.sender.id)

manager.download({
window: BrowserWindow.fromId(event.sender.id),
window: browserWindow,
url,
callbacks: {
// item is an instance of Electron.DownloadItem
Expand All @@ -102,7 +103,7 @@ ipcMain.handle('download-file', async (event, args) => {

// Send the download id back to the renderer along
// with some other data
ipcMain.invoke('download-started', {
browserWindow.webContents.invoke('download-started', {
id,
// The filename that the file will be saved as
filename: resolvedFilename,
Expand All @@ -112,7 +113,7 @@ ipcMain.handle('download-file', async (event, args) => {
},
onDownloadProgress: async ({ id, item, percentCompleted }) => {
// Send the download progress back to the renderer
ipcMain.invoke('download-progress', {
browserWindow.webContents.invoke('download-progress', {
id,
percentCompleted,
// Get the number of bytes received so far
Expand All @@ -121,7 +122,7 @@ ipcMain.handle('download-file', async (event, args) => {
},
onDownloadCompleted: async ({ id, item }) => {
// Send the download completion back to the renderer
ipcMain.invoke('download-completed', {
browserWindow.webContents.invoke('download-completed', {
id,
// Get the path to the file that was downloaded
filePath: item.getSavePath(),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-dl-manager",
"version": "1.0.0",
"version": "1.0.1",
"description": "A library for implementing file downloads in Electron with 'save as' dialog and id support.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 661baac

Please sign in to comment.