[Config] Fix notification filter setting not loading.

This commit is contained in:
Kuba Szczodrzyński 2021-10-22 17:03:20 +02:00
parent f3e2d21b89
commit e2ad3758e0
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB

View File

@ -4,12 +4,12 @@
package pl.szczodrzynski.edziennik.config package pl.szczodrzynski.edziennik.config
import pl.szczodrzynski.edziennik.config.utils.get import pl.szczodrzynski.edziennik.config.utils.getIntList
import pl.szczodrzynski.edziennik.config.utils.set import pl.szczodrzynski.edziennik.config.utils.set
class ProfileConfigSync(private val config: ProfileConfig) { class ProfileConfigSync(private val config: ProfileConfig) {
private var mNotificationFilter: List<Int>? = null private var mNotificationFilter: List<Int>? = null
var notificationFilter: List<Int> var notificationFilter: List<Int>
get() { mNotificationFilter = mNotificationFilter ?: config.values.get("notificationFilter", listOf()); return mNotificationFilter ?: listOf() } get() { mNotificationFilter = mNotificationFilter ?: config.values.getIntList("notificationFilter", listOf()); return mNotificationFilter ?: listOf() }
set(value) { config.set("notificationFilter", value); mNotificationFilter = value } set(value) { config.set("notificationFilter", value); mNotificationFilter = value }
} }