mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
purchase fix
This commit is contained in:
parent
3a32d5d906
commit
af8522b121
3 changed files with 10 additions and 5 deletions
|
|
@ -149,8 +149,8 @@ android {
|
|||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
|
||||
|
||||
versionCode 2956
|
||||
versionName "3.2.4"
|
||||
versionCode 2960
|
||||
versionName "3.2.4.1"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import io.realm.Realm
|
|||
import io.realm.RealmObject
|
||||
import io.realm.RealmResults
|
||||
import io.realm.Sort
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.HashMap
|
||||
|
||||
|
|
@ -351,7 +352,12 @@ class RealmInventoryLocalRepository(realm: Realm) : RealmContentLocalRepository(
|
|||
.findAll()
|
||||
.asFlowable()
|
||||
.filter { it.isLoaded && it.size > 0}
|
||||
.map { it.first() })
|
||||
.map {
|
||||
val format = SimpleDateFormat("yyyyMM", Locale.US)
|
||||
it.first {
|
||||
it.key?.contains(format.format(Date())) == true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun soldItem(userID: String, updatedUser: User): User {
|
||||
|
|
|
|||
|
|
@ -467,6 +467,7 @@ class PurchaseDialog(context: Context, component: UserComponent?, val item: Shop
|
|||
.doOnComplete {
|
||||
if (!shouldWarn) {
|
||||
onResult(-1)
|
||||
return@doOnComplete
|
||||
}
|
||||
val remaining = totalCount - ownedCount
|
||||
onResult(max(0, remaining))
|
||||
|
|
@ -490,8 +491,6 @@ class PurchaseDialog(context: Context, component: UserComponent?, val item: Shop
|
|||
ownedCount += if (pet.trained > 0) 1 else 0
|
||||
}
|
||||
}
|
||||
val remaining = totalCount - ownedCount
|
||||
onResult(max(0, remaining))
|
||||
}, RxErrorHandler.handleEmptyError())
|
||||
} else {
|
||||
onResult(-1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue