mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
fixed the add download file process
This commit is contained in:
parent
4bc4519ee8
commit
bffe399690
@ -89,6 +89,7 @@ function addFile(url) {
|
||||
rs.rsJsonApiRequest('/rsFiles/FileRequest', {
|
||||
fileName: details.name,
|
||||
hash: details.hash,
|
||||
flags: util.RS_FILE_REQ_ANONYMOUS_ROUTING,
|
||||
size: Number.parseInt(details.size),
|
||||
}, (status) => {
|
||||
widget.popupMessage([
|
||||
|
||||
@ -4,6 +4,7 @@ let rs = require('rswebui');
|
||||
const RS_FILE_CTRL_PAUSE = 0x00000100;
|
||||
const RS_FILE_CTRL_START = 0x00000200;
|
||||
const RS_FILE_CTRL_FORCE_CHECK = 0x00000400;
|
||||
|
||||
const FT_STATE_FAILED = 0x0000;
|
||||
const FT_STATE_OKAY = 0x0001;
|
||||
const FT_STATE_WAITING = 0x0002;
|
||||
@ -13,6 +14,8 @@ const FT_STATE_QUEUED = 0x0005;
|
||||
const FT_STATE_PAUSED = 0x0006;
|
||||
const FT_STATE_CHECKING_HASH = 0x0007;
|
||||
|
||||
const RS_FILE_REQ_ANONYMOUS_ROUTING = 0x00000040
|
||||
|
||||
function makeFriendlyUnit(bytes) {
|
||||
if(bytes < 1e3)
|
||||
return bytes.toFixed(1) + 'B';
|
||||
@ -169,6 +172,7 @@ module.exports = {
|
||||
FT_STATE_QUEUED,
|
||||
FT_STATE_PAUSED,
|
||||
FT_STATE_CHECKING_HASH,
|
||||
RS_FILE_REQ_ANONYMOUS_ROUTING,
|
||||
makeFriendlyUnit,
|
||||
File,
|
||||
SearchBar,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user