mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-07 01:28:56 +01:00
Fix migration "Attempt to invoke virtual method" crash (#2632)
This commit is contained in:
@@ -315,13 +315,6 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
||||
private val sourceManager: SourceManager = Injekt.get(),
|
||||
) : StateScreenModel<ScreenModel.State>(State()) {
|
||||
|
||||
init {
|
||||
screenModelScope.launchIO {
|
||||
initSources()
|
||||
mutableState.update { it.copy(isLoading = false) }
|
||||
}
|
||||
}
|
||||
|
||||
private val sourcesComparator = { includedSources: List<Long> ->
|
||||
compareBy<MigrationSource>(
|
||||
{ !it.isSelected },
|
||||
@@ -330,6 +323,13 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
||||
)
|
||||
}
|
||||
|
||||
init {
|
||||
screenModelScope.launchIO {
|
||||
initSources()
|
||||
mutableState.update { it.copy(isLoading = false) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSources(save: Boolean = true, action: (List<MigrationSource>) -> List<MigrationSource>) {
|
||||
mutableState.update { state ->
|
||||
val updatedSources = action(state.sources)
|
||||
|
||||
Reference in New Issue
Block a user