Fix (IntegratedHentaiMigration): correctly migrate old users
This commit is contained in:
parent
1247d4e466
commit
20d0b87b3a
1 changed files with 5 additions and 2 deletions
|
|
@ -9,8 +9,11 @@ class IntegratedHentaiMigration : Migration {
|
||||||
override val version: Float = 71f
|
override val version: Float = 71f
|
||||||
|
|
||||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
|
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
|
||||||
val unsortedPreferences = migrationContext.get<UnsortedPreferences>() ?: return@withIOContext false
|
val isHentaiEnabled = migrationContext.get<UnsortedPreferences>()?.isHentaiEnabled()
|
||||||
unsortedPreferences.isHentaiEnabled().set(true)
|
?: return@withIOContext false
|
||||||
|
if (!isHentaiEnabled.isSet() || isHentaiEnabled.get()) {
|
||||||
|
isHentaiEnabled.set(true)
|
||||||
|
}
|
||||||
return@withIOContext true
|
return@withIOContext true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue