From 742bd03e9e41e30d2e3fd2dd62870af9128c8cd4 Mon Sep 17 00:00:00 2001 From: kuba2k2 Date: Wed, 26 Oct 2022 10:31:03 +0200 Subject: [PATCH] [Lab] Fix JSON page crashing because of serializing AppDb. --- .../main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt | 1 + .../java/pl/szczodrzynski/edziennik/data/db/entity/Profile.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt index ac3a8af9..69d232c5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt @@ -14,6 +14,7 @@ import pl.szczodrzynski.edziennik.ext.takePositive import kotlin.coroutines.CoroutineContext abstract class BaseConfig( + @Transient val db: AppDb, val profileId: Int? = null, protected var entries: List? = null, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Profile.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Profile.kt index c5d3f542..8e689883 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Profile.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Profile.kt @@ -91,6 +91,7 @@ open class Profile( get() = registration == REGISTRATION_ENABLED && !archived @delegate:Ignore + @delegate:Transient val config by lazy { App.config[this.id] } override fun getImageDrawable(context: Context) = this.getDrawable(context)