Refactor `.length > 0` pattern

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
bytedream 2024-03-25 19:56:14 +01:00 committed by GitHub
parent 17f351b68e
commit c7a8412b3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ const sfc = {
}
// scrolls to the bottom if job is running and the bottom of the logs container is visible
if (!this.run.done && logLines.length > 0 && clientHeight >= logsContainerHeight) {
if (!this.run.done && logLines.length && clientHeight >= logsContainerHeight) {
const newLogsContainerHeight = this.$refs.stepsContainer.getBoundingClientRect().bottom + window.scrollY;
window.scrollTo({top: clientHeight + (newLogsContainerHeight - logsContainerHeight), behavior: 'smooth'});
}