Display file transfer index
This commit is contained in:
parent
bd795ca995
commit
e953b7b335
@ -188,10 +188,10 @@ document.getElementById("attach_file").onchange = function(event) {
|
|||||||
mainDiv.appendChild(p);
|
mainDiv.appendChild(p);
|
||||||
showPopup(mainDiv);
|
showPopup(mainDiv);
|
||||||
} else {
|
} else {
|
||||||
let fileTransfers = [];
|
let filesTransfer = [];
|
||||||
let fileInfo = "";
|
let fileInfo = "";
|
||||||
for (let i=0; i<files.length; ++i) {
|
for (let i=0; i<files.length; ++i) {
|
||||||
fileTransfers.push({
|
filesTransfer.push({
|
||||||
"file": files[i],
|
"file": files[i],
|
||||||
"name": files[i].name,
|
"name": files[i].name,
|
||||||
"size": files[i].size,
|
"size": files[i].size,
|
||||||
@ -201,7 +201,7 @@ document.getElementById("attach_file").onchange = function(event) {
|
|||||||
fileInfo += ' '+files[i].size+' '+b64EncodeUnicode(files[i].name);
|
fileInfo += ' '+files[i].size+' '+b64EncodeUnicode(files[i].name);
|
||||||
};
|
};
|
||||||
pendingFilesTransfers.set(currentSessionId, {
|
pendingFilesTransfers.set(currentSessionId, {
|
||||||
"files": fileTransfers,
|
"files": filesTransfer,
|
||||||
"index": 0,
|
"index": 0,
|
||||||
"state": "waiting",
|
"state": "waiting",
|
||||||
});
|
});
|
||||||
@ -1091,6 +1091,7 @@ function displayChatBottom(speed = undefined) {
|
|||||||
fileInfo.innerHTML = "";
|
fileInfo.innerHTML = "";
|
||||||
let filesTransfer = pendingFilesTransfers.get(currentSessionId);
|
let filesTransfer = pendingFilesTransfers.get(currentSessionId);
|
||||||
let file = filesTransfer.files[filesTransfer.index];
|
let file = filesTransfer.files[filesTransfer.index];
|
||||||
|
fileInfo.appendChild(document.createTextNode(filesTransfer.index+1+"/"+filesTransfer.files.length+": "));
|
||||||
generateFileInfo(file.name, file.size, fileInfo);
|
generateFileInfo(file.name, file.size, fileInfo);
|
||||||
let fileProgress = document.getElementById("file_progress");
|
let fileProgress = document.getElementById("file_progress");
|
||||||
fileProgress.style.display = "none"; //hide by default
|
fileProgress.style.display = "none"; //hide by default
|
||||||
|
Loading…
Reference in New Issue
Block a user