mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 05:48:19 +01:00
[Config] Disable teacher absence notifications by default. Add missing migration values.
This commit is contained in:
parent
219a7443c0
commit
2f3c912dbe
@ -22,7 +22,7 @@ import kotlin.coroutines.CoroutineContext
|
|||||||
|
|
||||||
class Config(val db: AppDb) : CoroutineScope, AbstractConfig {
|
class Config(val db: AppDb) : CoroutineScope, AbstractConfig {
|
||||||
companion object {
|
companion object {
|
||||||
const val DATA_VERSION = 11
|
const val DATA_VERSION = 12
|
||||||
}
|
}
|
||||||
|
|
||||||
private val job = Job()
|
private val job = Job()
|
||||||
|
@ -18,7 +18,7 @@ import kotlin.coroutines.CoroutineContext
|
|||||||
|
|
||||||
class ProfileConfig(val db: AppDb, val profileId: Int, rawEntries: List<ConfigEntry>) : CoroutineScope, AbstractConfig {
|
class ProfileConfig(val db: AppDb, val profileId: Int, rawEntries: List<ConfigEntry>) : CoroutineScope, AbstractConfig {
|
||||||
companion object {
|
companion object {
|
||||||
const val DATA_VERSION = 1
|
const val DATA_VERSION = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
private val job = Job()
|
private val job = Job()
|
||||||
|
@ -64,11 +64,25 @@ class ConfigMigration(app: App, config: Config) {
|
|||||||
dataVersion = 2
|
dataVersion = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataVersion < 3) {
|
||||||
|
update = null
|
||||||
|
privacyPolicyAccepted = false
|
||||||
|
debugMode = false
|
||||||
|
devModePassword = null
|
||||||
|
appInstalledTime = 0L
|
||||||
|
appRateSnackbarTime = 0L
|
||||||
|
|
||||||
|
dataVersion = 3
|
||||||
|
}
|
||||||
|
|
||||||
if (dataVersion < 10) {
|
if (dataVersion < 10) {
|
||||||
ui.openDrawerOnBackPressed = false
|
ui.openDrawerOnBackPressed = false
|
||||||
ui.snowfall = false
|
ui.snowfall = false
|
||||||
ui.bottomSheetOpened = false
|
ui.bottomSheetOpened = false
|
||||||
sync.dontShowAppManagerDialog = false
|
sync.dontShowAppManagerDialog = false
|
||||||
|
sync.webPushEnabled = true
|
||||||
|
sync.lastAppSync = 0L
|
||||||
|
|
||||||
|
|
||||||
dataVersion = 10
|
dataVersion = 10
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package pl.szczodrzynski.edziennik.config.utils
|
package pl.szczodrzynski.edziennik.config.utils
|
||||||
|
|
||||||
import pl.szczodrzynski.edziennik.config.ProfileConfig
|
import pl.szczodrzynski.edziennik.config.ProfileConfig
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.entity.Notification
|
||||||
import pl.szczodrzynski.edziennik.data.db.entity.Profile.Companion.AGENDA_DEFAULT
|
import pl.szczodrzynski.edziennik.data.db.entity.Profile.Companion.AGENDA_DEFAULT
|
||||||
import pl.szczodrzynski.edziennik.utils.managers.GradesManager.Companion.COLOR_MODE_WEIGHTED
|
import pl.szczodrzynski.edziennik.utils.managers.GradesManager.Companion.COLOR_MODE_WEIGHTED
|
||||||
import pl.szczodrzynski.edziennik.utils.managers.GradesManager.Companion.YEAR_ALL_GRADES
|
import pl.szczodrzynski.edziennik.utils.managers.GradesManager.Companion.YEAR_ALL_GRADES
|
||||||
@ -14,11 +15,23 @@ class ProfileConfigMigration(config: ProfileConfig) {
|
|||||||
|
|
||||||
if (dataVersion < 1) {
|
if (dataVersion < 1) {
|
||||||
grades.colorMode = COLOR_MODE_WEIGHTED
|
grades.colorMode = COLOR_MODE_WEIGHTED
|
||||||
grades.dontCountEnabled = false
|
|
||||||
grades.yearAverageMode = YEAR_ALL_GRADES
|
grades.yearAverageMode = YEAR_ALL_GRADES
|
||||||
|
grades.hideImproved = false
|
||||||
|
grades.averageWithoutWeight = true
|
||||||
|
grades.plusValue = null
|
||||||
|
grades.minusValue = null
|
||||||
|
grades.dontCountEnabled = false
|
||||||
|
grades.dontCountGrades = listOf()
|
||||||
ui.agendaViewType = AGENDA_DEFAULT
|
ui.agendaViewType = AGENDA_DEFAULT
|
||||||
|
// no migration for ui.homeCards
|
||||||
|
|
||||||
dataVersion = 1
|
dataVersion = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataVersion < 2) {
|
||||||
|
sync.notificationFilter = sync.notificationFilter + Notification.TYPE_TEACHER_ABSENCE
|
||||||
|
|
||||||
|
dataVersion = 2
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user