From 2b684a48af519cbbabfc865730bb928b50c8c547 Mon Sep 17 00:00:00 2001 From: rottencandy Date: Thu, 8 Aug 2019 11:43:08 +0530 Subject: [PATCH] Add correct file hints for uploads --- webui-src/app/files/files_uploads.js | 8 ++++---- webui-src/app/rswebui.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/webui-src/app/files/files_uploads.js b/webui-src/app/files/files_uploads.js index f5dca98..08d2ace 100644 --- a/webui-src/app/files/files_uploads.js +++ b/webui-src/app/files/files_uploads.js @@ -3,11 +3,11 @@ let rs = require('rswebui'); let util = require('files_util') -function setHashDetail(hash, isNew = false) { +function updateFileDetail(hash, isNew = false) { rs.rsJsonApiRequest( '/rsFiles/FileDetails', { hash, - hintflags: 16, // RS_FILE_HINTS_DOWNLOAD + hintflags: 32, // RS_FILE_HINTS_UPLOAD }, (fileStat) => { if(!fileStat.retval) { @@ -41,7 +41,7 @@ let Uploads = { if(Uploads.hashes.length > fileKeys.length) { let newHashes = util.compareArrays(Uploads.hashes, fileKeys); for(let hash of newHashes) { - setHashDetail(hash, true); + updateFileDetail(hash, true); } } // Existing file removed @@ -53,7 +53,7 @@ let Uploads = { } } for(let hash in Uploads.statusMap) { - setHashDetail(hash); + updateFileDetail(hash); } }, }; diff --git a/webui-src/app/rswebui.js b/webui-src/app/rswebui.js index 1dcb5a1..f84b3c6 100644 --- a/webui-src/app/rswebui.js +++ b/webui-src/app/rswebui.js @@ -27,8 +27,8 @@ function rsJsonApiRequest(path, data, callback, async = true, 'Basic ' + btoa(loginKey.username + ':' + loginKey.passwd); } - console.info('Sending request: \nPath: ' + path + '\nData: ' + data + - '\nHeaders:' + headers); + console.info('Sending request: \nPath: ', path, '\nData: ', data, + '\nHeaders:', headers); // TODO: Properly handle types of fail situtations // Eg. Retroshare switched off, wrong path, incorrect data, etc. return m.request({