Show torrent file name based on magnet URI

master
Torjus 2018-07-30 11:37:51 +02:00
parent c908fa8855
commit 37f7af3778
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import magnet from 'magnet-uri';
import * as requestActions from '../../redux/requestActions';
import { saveAs } from 'file-saver/FileSaver';
import { client } from './FileSharing';
@ -96,6 +97,8 @@ class FileChatEntry extends Component
<Fragment>
<p>A new file was shared.</p>
<p>{magnet.decode(this.props.message.file.magnet).dn}</p>
<button onClick={this.download}>
Download
</button>

7
app/package-lock.json generated
View File

@ -7912,11 +7912,10 @@
}
},
"magnet-uri": {
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/magnet-uri/-/magnet-uri-5.1.8.tgz",
"integrity": "sha512-rHCJ81C3W2MuLpb4c3JKshQtCbRZhgeKKNYy1YFBtLR3eAB0FjQ5thfCo16w/+VF9yN5tJDtDq4NHPtf9a328A==",
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/magnet-uri/-/magnet-uri-5.2.3.tgz",
"integrity": "sha512-INWVwcpWfZTVM+Yb4EXVBpm0FTd8Q98Fn5x7nuHv1hkFDRELgdIM+eJ3zYLbNTFpFPYtHs6B+sx8exs29IYwgA==",
"requires": {
"safe-buffer": "^5.0.1",
"thirty-two": "^1.0.1",
"uniq": "^1.0.1",
"xtend": "^4.0.0"

View File

@ -17,6 +17,7 @@
"fscreen": "^1.0.2",
"hark": "^1.2.2",
"js-cookie": "^2.2.0",
"magnet-uri": "^5.2.3",
"marked": "^0.4.0",
"mediasoup-client": "^2.1.1",
"prop-types": "^15.6.2",