Making the save file dialog sync to ensure working properly on MacOS and others
This commit is contained in:
@@ -299,15 +299,15 @@ module.exports = class TorrentListController {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
electron.remote.dialog.showSaveDialog(win, opts, function (savePath) {
|
const savePath = electron.remote.dialog.showSaveDialogSync(win, opts)
|
||||||
console.log('Saving torrent ' + torrentKey + ' to ' + savePath)
|
|
||||||
if (!savePath) return // They clicked Cancel
|
console.log('Saving torrent ' + torrentKey + ' to ' + savePath)
|
||||||
const torrentPath = TorrentSummary.getTorrentPath(torrentSummary)
|
if (!savePath) return // They clicked Cancel
|
||||||
fs.readFile(torrentPath, function (err, torrentFile) {
|
const torrentPath = TorrentSummary.getTorrentPath(torrentSummary)
|
||||||
|
fs.readFile(torrentPath, function (err, torrentFile) {
|
||||||
|
if (err) return dispatch('error', err)
|
||||||
|
fs.writeFile(savePath, torrentFile, function (err) {
|
||||||
if (err) return dispatch('error', err)
|
if (err) return dispatch('error', err)
|
||||||
fs.writeFile(savePath, torrentFile, function (err) {
|
|
||||||
if (err) return dispatch('error', err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user