removing legacy migration flag from 12 months ago

This commit is contained in:
Adam Brown 2022-07-12 09:57:48 +01:00
parent bdc370474e
commit 6266b2019b
1 changed files with 1 additions and 22 deletions

View File

@ -158,7 +158,6 @@ class VectorPreferences @Inject constructor(
private const val SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY = "SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY"
const val SETTINGS_LABS_ALLOW_EXTENDED_LOGS = "SETTINGS_LABS_ALLOW_EXTENDED_LOGS"
const val SETTINGS_LABS_SPACES_HOME_AS_ORPHAN = "SETTINGS_LABS_SPACES_HOME_AS_ORPHAN"
const val SETTINGS_LABS_AUTO_REPORT_UISI = "SETTINGS_LABS_AUTO_REPORT_UISI"
const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME = "SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME"
@ -1025,27 +1024,7 @@ class VectorPreferences @Inject constructor(
}
fun prefSpacesShowAllRoomInHome(): Boolean {
val defaultValue = false
return when {
defaultPrefs.contains(SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME) -> {
defaultPrefs.getBoolean(SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME, defaultValue)
}
defaultPrefs.contains(SETTINGS_LABS_SPACES_HOME_AS_ORPHAN) -> migrateOrphansInSpacesToShowAllInHome()
else -> defaultValue
}
}
private fun migrateOrphansInSpacesToShowAllInHome(): Boolean {
val showAllRoomsInHome = !labsSpacesOnlyOrphansInHome()
defaultPrefs.edit {
putBoolean(SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME, showAllRoomsInHome)
remove(SETTINGS_LABS_SPACES_HOME_AS_ORPHAN)
}
return showAllRoomsInHome
}
private fun labsSpacesOnlyOrphansInHome(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_LABS_SPACES_HOME_AS_ORPHAN, false)
return defaultPrefs.getBoolean(SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME, false)
}
/*