Skip to content

Commit

Permalink
Skip: Get updated object count for download (merge commit)
Browse files Browse the repository at this point in the history
Merge branch 'bugfix/download-just-uploaded-objects' into 'main'
* Get updated object count for download

Closes #1232
See merge request https://gitlab.ci.csc.fi/sds-dev/sd-connect/swift-browser-ui/-/merge_requests/309

Approved-by: Hang Le <lhang@csc.fi>
Co-authored-by: Monika Radaviciute <mradavic@csc.fi>
Merged by Hang Le <lhang@csc.fi>
  • Loading branch information
Hang Le committed Apr 9, 2024
2 parents 0523128 + 1499eed commit 835bd79
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion swift_browser_ui_frontend/src/common/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,17 @@ export default class UploadSocket {
projectID: this.active.id,
name: container,
});

const dbContainerFileCount = await getDB().objects
.where({"containerID": dbContainer.id})
.count();

let dbContainerFiles = [];
while (dbContainerFiles.length < dbContainer.count) {

while (dbContainerFiles.length < dbContainerFileCount
|| dbContainerFiles.length < dbContainer.count) {
//check both: container.count not updated in obj view, and
//obj count might not be updated in time if there's many
dbContainerFiles = await getDB().objects
.where({"containerID": dbContainer.id})
.toArray();
Expand Down

0 comments on commit 835bd79

Please sign in to comment.