Partially revert: ErrorActivity: Kotlin-fy buildMarkdown method

Partially reverts c3dbed54e50430b585e9d7b88cf22c9f3a6cc54c
Fix the bug where collapse container for several crashlogs is created
when only one crash log present
This commit is contained in:
Yevhen Babiichuk (DustDFG) 2026-02-13 13:33:27 +02:00
parent 3815f5f593
commit 70cdaf5550

View File

@ -228,24 +228,26 @@ class ErrorActivity : AppCompatActivity() {
// Collapse all logs to a single paragraph when there are more than one // Collapse all logs to a single paragraph when there are more than one
// to keep the GitHub issue clean. // to keep the GitHub issue clean.
if (errorInfo.stackTraces.isNotEmpty()) { if (errorInfo.stackTraces.size > 1) {
append("<details><summary><b>Exceptions (") append("<details><summary><b>Exceptions (")
append(errorInfo.stackTraces.size) append(errorInfo.stackTraces.size)
append(")</b></summary><p>\n") append(")</b></summary><p>\n")
}
// add the logs // add the logs
errorInfo.stackTraces.forEachIndexed { index, stacktrace -> errorInfo.stackTraces.forEachIndexed { index, stacktrace ->
append("<details><summary><b>Crash log ") append("<details><summary><b>Crash log ")
if (errorInfo.stackTraces.isNotEmpty()) { if (errorInfo.stackTraces.size > 1) {
append(index + 1) append(index + 1)
}
append("</b>")
append("</summary><p>\n")
append("\n```\n${stacktrace}\n```\n")
append("</details>\n")
} }
append("</b>")
append("</summary><p>\n")
append("\n```\n${stacktrace}\n```\n")
append("</details>\n")
}
// make sure to close everything // make sure to close everything
if (errorInfo.stackTraces.size > 1) {
append("</p></details>\n") append("</p></details>\n")
} }