Fix migration "Attempt to invoke virtual method" crash (mihonapp/mihon#2632)
(cherry picked from commit 93ba6acea56334573fc506d593affd5bea2a86b2)
This commit is contained in:
parent
b28778221e
commit
9a3934eadf
1 changed files with 7 additions and 7 deletions
|
|
@ -406,13 +406,6 @@ class MigrationConfigScreen(private val mangaIds: List<Long>) : Screen() {
|
||||||
private val disabledSources by lazy { sourcePreferences.disabledSources().get().mapNotNull { it.toLongOrNull() } }
|
private val disabledSources by lazy { sourcePreferences.disabledSources().get().mapNotNull { it.toLongOrNull() } }
|
||||||
// KMK <--
|
// KMK <--
|
||||||
|
|
||||||
init {
|
|
||||||
screenModelScope.launchIO {
|
|
||||||
initSources()
|
|
||||||
mutableState.update { it.copy(isLoading = false) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private val sourcesComparator = { includedSources: /* KMK --> */ Map<Long, Int> /* KMK <-- */ ->
|
private val sourcesComparator = { includedSources: /* KMK --> */ Map<Long, Int> /* KMK <-- */ ->
|
||||||
compareBy<MigrationSource>(
|
compareBy<MigrationSource>(
|
||||||
// KMK -->
|
// KMK -->
|
||||||
|
|
@ -423,6 +416,13 @@ class MigrationConfigScreen(private val mangaIds: List<Long>) : Screen() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
screenModelScope.launchIO {
|
||||||
|
initSources()
|
||||||
|
mutableState.update { it.copy(isLoading = false) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateSources(save: Boolean = true, action: (List<MigrationSource>) -> List<MigrationSource>) {
|
private fun updateSources(save: Boolean = true, action: (List<MigrationSource>) -> List<MigrationSource>) {
|
||||||
mutableState.update { state ->
|
mutableState.update { state ->
|
||||||
val updatedSources = action(state.sources)
|
val updatedSources = action(state.sources)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue