Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 605b5be

Browse files
committed
relax the way we crop the code in the raw tab
Fixes #123
1 parent 2bca831 commit 605b5be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/content/js/ui.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,8 @@ const ui = (function() {
743743
if (raw.length < 10 * 1024) {
744744
prettyJSON(raw, container)
745745
} else {
746-
// too big to beautify
746+
// too big to beautify; try to elide the code bits and
747+
// then we'll re-check
747748
const raw = JSON.stringify(value, (key, value) => {
748749
if (key == 'code') {
749750
// maybe this is why we're too big??
@@ -753,9 +754,12 @@ const ui = (function() {
753754
}
754755
}, 4)
755756

756-
if (raw.length > 10 * 1024) {
757-
container.innerText = raw.substring(0, 10 * 1024) + '\u2026'
757+
// re-checking!
758+
if (raw.length > 1 * 1024 * 1024) {
759+
// oof, still too big, crop and add a tail ellision
760+
container.innerText = raw.substring(0, 1 * 1024 * 1024) + '\u2026'
758761
} else {
762+
// yay, eliding the code helped
759763
prettyJSON(raw, container)
760764
}
761765
}

0 commit comments

Comments
 (0)