Document why 'open-file' is there

This commit is contained in:
Ash Wilson
2019-04-23 11:53:25 -04:00
parent 405304d449
commit 8a933d879c

View File

@@ -597,6 +597,9 @@ class AtomApplication extends EventEmitter {
this.deleteSocketSecretFile()
}))
// Triggered by the 'open-file' event from Electron:
// https://electronjs.org/docs/api/app#event-open-file-macos
// For example, this is fired when a file is dragged and dropped onto the dock.
this.disposable.add(ipcHelpers.on(app, 'open-file', (event, pathToOpen) => {
event.preventDefault()
this.openPath({pathToOpen})