We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1247d4e commit 20d0b87Copy full SHA for 20d0b87
app/src/main/java/mihon/core/migration/migrations/IntegratedHentaiMigration.kt
@@ -9,8 +9,11 @@ class IntegratedHentaiMigration : Migration {
9
override val version: Float = 71f
10
11
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
12
- val unsortedPreferences = migrationContext.get<UnsortedPreferences>() ?: return@withIOContext false
13
- unsortedPreferences.isHentaiEnabled().set(true)
+ val isHentaiEnabled = migrationContext.get<UnsortedPreferences>()?.isHentaiEnabled()
+ ?: return@withIOContext false
14
+ if (!isHentaiEnabled.isSet() || isHentaiEnabled.get()) {
15
+ isHentaiEnabled.set(true)
16
+ }
17
return@withIOContext true
18
}
19
0 commit comments