mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-21 05:09:00 +00:00
fix duplicate items
This commit is contained in:
parent
f6829e587b
commit
5ff6574b17
3 changed files with 11 additions and 10 deletions
|
|
@ -178,15 +178,15 @@ class TaskRepositoryImpl(
|
|||
item.key = key
|
||||
item.itemType = type
|
||||
item.userID = user.id
|
||||
|
||||
when (type) {
|
||||
"eggs" -> bgUser.items?.eggs?.add(item)
|
||||
"food" -> bgUser.items?.food?.add(item)
|
||||
"hatchingPotions" -> bgUser.items?.hatchingPotions?.add(item)
|
||||
"quests" -> bgUser.items?.quests?.add(item)
|
||||
}
|
||||
}
|
||||
item.numberOwned += 1
|
||||
when (type) {
|
||||
"eggs" -> bgUser.items?.eggs?.add(item)
|
||||
"food" -> bgUser.items?.food?.add(item)
|
||||
"hatchingPotions" -> bgUser.items?.hatchingPotions?.add(item)
|
||||
"quests" -> bgUser.items?.quests?.add(item)
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
bgUser.stats?.hp = res.hp
|
||||
|
|
|
|||
|
|
@ -99,7 +99,8 @@ class UserRepositoryImpl(
|
|||
}
|
||||
|
||||
override suspend fun revive(): User? {
|
||||
apiClient.revive()
|
||||
val revivedUser = apiClient.revive()
|
||||
|
||||
return retrieveUser(false, true)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ object DataBindingUtils {
|
|||
imageName.startsWith("handleless") -> "chair_$imageName"
|
||||
else -> imageName
|
||||
}
|
||||
return name + if (imageFormat == null && FILEFORMAT_MAP.containsKey(name)) {
|
||||
"." + FILEFORMAT_MAP[name]
|
||||
return name + if (imageFormat == null && FILEFORMAT_MAP.containsKey(imageName)) {
|
||||
"." + FILEFORMAT_MAP[imageName]
|
||||
} else {
|
||||
".${imageFormat ?: "png"}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue