sindresorhus / electron-dl

Simplified file downloads for your Electron app
MIT License
1.16k stars 137 forks source link

Enable an app to display a custom "interrupted" dialog #105

Open ctrlaltdavid opened 4 years ago

ctrlaltdavid commented 4 years ago

Rather than just allowing the 'The download of {filename} was interrupted' system message box text to be customized, enable the app to provide a dialog box styled per the app.

Could perhaps be achieved by one of: (a) Add an 'onError' optional callback. (No "interrupted" dialog is displayed is this callback is specified.) (b) Allow a blank string to be specified as the value of 'errorMessage'. (No "interrupted" dialog is displayed if the string is ""; the "interrupted" result can be found by testing the 'state' returned by the 'done' event).

sindresorhus commented 4 years ago

I would go with a.

theogravity commented 7 months ago

I have this feature implemented in my library where you can hook into an error or interrupted callback:

https://github.com/theogravity/electron-dl-manager