Skip to content

Commit

Permalink
UX: Do not display negative ETA in Web upload dialog #4285
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Mayer <michael@photoprism.app>
  • Loading branch information
lastzero committed May 21, 2024
1 parent 5e655ec commit 885a42f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
23 changes: 13 additions & 10 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@babel/runtime": "^7.24.5",
"@lcdp/offline-plugin": "^5.1.1",
"@vvo/tzdb": "^6.139.0",
"axios": "^1.7.0",
"axios": "^1.7.1",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
Expand Down
14 changes: 9 additions & 5 deletions frontend/src/dialog/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,15 @@ export default {
const rate = currentSize / elapsedTime;
const ms = this.totalSize / rate - elapsedTime;
this.remainingTime = Math.ceil(ms * 0.001);
const dur = Duration.fromObject({
minutes: Math.floor(this.remainingTime / 60),
seconds: this.remainingTime % 60,
});
this.eta = dur.toHuman();
if (this.remainingTime > 0) {
const dur = Duration.fromObject({
minutes: Math.floor(this.remainingTime / 60),
seconds: this.remainingTime % 60,
});
this.eta = dur.toHuman();
} else {
this.eta = "";
}
}
}
},
Expand Down

0 comments on commit 885a42f

Please sign in to comment.