client: TorrentActions: create: trigger download first

This commit is contained in:
Jesse Chan
2020-10-19 23:06:39 +08:00
parent 1b583f0fcb
commit 4da15d4a08
@@ -77,13 +77,13 @@ const TorrentActions = {
createTorrent: (options: CreateTorrentOptions) =>
axios.post(`${baseURI}api/torrents/create`, options, {responseType: 'blob'}).then(
(response) => {
download(response.data, (options.name || `${Date.now()}`).concat('.torrent'));
AppDispatcher.dispatchServerAction({
type: 'CLIENT_ADD_TORRENT_SUCCESS',
data: {
count: 1,
},
});
download(response.data, (options.name || `${Date.now()}`).concat('.torrent'));
},
() => {
AppDispatcher.dispatchServerAction({