mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-26 09:44:55 +00:00
revealedItemCount while loop
This commit is contained in:
+4
-1
@@ -221,12 +221,15 @@ fun List<ChatSection>.chatItemPosition(chatItemId: Long): Int? {
|
||||
fun List<ChatSection>.revealedItemCount(): Int {
|
||||
var count = 0
|
||||
for (section in this) {
|
||||
for (item in section.items) {
|
||||
var i = 0;
|
||||
while (i < section.items.size) {
|
||||
val item = section.items[i]
|
||||
if (item.revealed) {
|
||||
count += item.items.size
|
||||
} else {
|
||||
count++
|
||||
}
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user