From 217ca9a0530391e2343758d457321330730cf07e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 25 May 2018 01:10:40 -0700 Subject: [PATCH] If torrent is not private, leave private flag unset If torrent is not private, leave private flag unset. This ensures that the torrent info hash will match the result generated by other tools, including webtorrent-cli. --- src/renderer/pages/create-torrent-page.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/pages/create-torrent-page.js b/src/renderer/pages/create-torrent-page.js index 13d14d94c3..fe532a5988 100644 --- a/src/renderer/pages/create-torrent-page.js +++ b/src/renderer/pages/create-torrent-page.js @@ -191,9 +191,14 @@ function handleSubmit () { path: this.state.basePath, files: this.state.files, announce: announceList, - private: this.state.isPrivate, comment: this.state.comment.trim() } + + // If torrent is not private, leave private flag unset. This ensures that + // the torrent info hash will match the result generated by other tools, + // including webtorrent-cli. + if (this.state.isPrivate) options.private = true + dispatch('createTorrent', options) }