Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ class PreferencesManager(context: Context) : CorePreferences, ProfilePreferences
saveString(APP_CONFIG, appConfigJson)
}
get() {
val appConfigString = getString(APP_CONFIG)
val appConfigString = getString(APP_CONFIG, getDefaultAppConfig())
return Gson().fromJson(appConfigString, AppConfig::class.java)
}

private fun getDefaultAppConfig() = Gson().toJson(AppConfig())

override var lastWhatsNewVersion: String
set(value) {
saveString(LAST_WHATS_NEW_VERSION, value)
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/openedx/core/domain/model/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package org.openedx.core.domain.model
import java.io.Serializable

data class AppConfig(
val courseDatesCalendarSync: CourseDatesCalendarSync,
val courseDatesCalendarSync: CourseDatesCalendarSync = CourseDatesCalendarSync(),
) : Serializable

data class CourseDatesCalendarSync(
val isEnabled: Boolean,
val isSelfPacedEnabled: Boolean,
val isInstructorPacedEnabled: Boolean,
val isDeepLinkEnabled: Boolean,
val isEnabled: Boolean = false,
val isSelfPacedEnabled: Boolean = false,
val isInstructorPacedEnabled: Boolean = false,
val isDeepLinkEnabled: Boolean = false,
) : Serializable