This commit is contained in:
Phillip Thelen 2021-05-25 17:33:50 +02:00
parent b3a804b2af
commit adca1cd62d
4 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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
}