Skip to content

Commit

Permalink
Fix coin issues counters
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed Apr 15, 2024
1 parent 3d888d1 commit 27d4afe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,26 @@ class CoinAnalyticsViewModel(
var medium = 0
var low = 0
issues.forEach { issue ->
var innerHigh = 0
var innerMedium = 0
var innerLow = 0
issue.issues?.forEach { issueItem ->
when (issueItem.impact) {
"Critical" -> high++
"High" -> medium++
"Critical",
"High" -> innerHigh++
"Medium" -> innerMedium++
"Low",
"Informational",
"Optimization" -> low++
"Informational" -> innerLow++
"Optimization" -> { /* ignore */}
}
}
if (innerHigh > 0) {
high++
} else if (innerMedium > 0) {
medium++
} else if (innerLow > 0) {
low++
}
}
val snippets = mutableListOf<CoinAnalyticsModule.IssueSnippet>()
if (high > 0) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@
<string name="CoinAnalytics_HighRiskItems">High Risk Items</string>
<string name="CoinAnalytics_MediumRiskItems">Medium Risk Items</string>
<string name="CoinAnalytics_AttentionRequired">Attention Required</string>
<string name="CoinAnalytics_PoweredByDeFi">Powered by De.Fi Yield App</string>
<string name="CoinAnalytics_PoweredByDeFi">Powered by De.Fi</string>
<string name="CoinAnalytics_CountItems">%d Items</string>

<string name="TechnicalAdvice_Title">Trading Assistant</string>
Expand Down

0 comments on commit 27d4afe

Please sign in to comment.