mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-31 19:20:34 +00:00
Fixes #1515
This commit is contained in:
parent
b3a804b2af
commit
adca1cd62d
4 changed files with 15 additions and 3 deletions
|
|
@ -13,6 +13,7 @@ open class Flags : RealmObject() {
|
|||
var dropsEnabled = false
|
||||
var itemsEnabled = false
|
||||
var newStuff = false
|
||||
var lastNewStuffRead: String? = null
|
||||
var classSelected = false
|
||||
var rebirthEnabled = false
|
||||
var welcomed = false
|
||||
|
|
|
|||
|
|
@ -10,19 +10,23 @@ open class OwnedCustomization : RealmObject(), OwnedObject {
|
|||
override var userID: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
combinedKey = field + type + key
|
||||
combinedKey = field + type + category + key
|
||||
}
|
||||
override var key: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
combinedKey = userID + type + field
|
||||
combinedKey = userID + type + category +field
|
||||
}
|
||||
|
||||
var type: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
combinedKey = userID + field + key
|
||||
combinedKey = userID + field + category +key
|
||||
}
|
||||
var category: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
combinedKey = userID + type + field + key
|
||||
}
|
||||
var purchased = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ import io.realm.annotations.PrimaryKey
|
|||
open class Purchases : RealmObject() {
|
||||
@PrimaryKey
|
||||
var userId: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
customizations?.forEach { it.userID = value }
|
||||
}
|
||||
@JvmField
|
||||
var customizations: RealmList<OwnedCustomization>? = null
|
||||
var user: User? = null
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ open class User : RealmObject(), BaseObject, Avatar, VersionedObject {
|
|||
if (preferences?.isManaged != true) {
|
||||
preferences?.userId = id
|
||||
}
|
||||
if (purchased?.isManaged != true) {
|
||||
purchased?.userId = id
|
||||
}
|
||||
if (this.profile?.isManaged != true) {
|
||||
this.profile?.userId = id
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue