Fix performance of debug logs view

This commit is contained in:
Fedor Indutny 2021-06-02 13:13:33 -07:00 committed by GitHub
parent ff94050c0a
commit 287abd241d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 11 deletions

View file

@ -111,8 +111,7 @@
// we need to scroll, but not so many that things get slow.
const linesToShow = Math.ceil(Math.min(window.innerHeight, 2000) / 5);
this.textarea.value = this.logText
.split(/\n/g)
.slice(0, linesToShow)
.split(/\n/g, linesToShow)
.concat(['', i18n('loading')])
.join('\n');