mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Add correct file hints for uploads
This commit is contained in:
parent
f18e6a1007
commit
2b684a48af
@ -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);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user