Created
September 13, 2021 06:48
-
-
Save kasem-sm/da680f28cba046bc845bf0816b8c4a57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result.data?.let { list -> | |
val totalCount = list.count() | |
// example there are 2 uploadedPosts | |
list.forEach { review -> | |
if (review.status.contains("Live")) { | |
/** if totalCount (posts) are 2 and both of them are live, | |
* minus 1 for each live post, so totalCount would be 0 | |
*/ | |
val finalCount = totalCount - 1 | |
isUploadEnabled.value = finalCount < 2 | |
} else { | |
isUploadEnabled.value = list.count() < 2 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment