Make the source manager surface suspend (#3869)

Assisted-by: Claude:claude-opus-5
This commit is contained in:
AntsyLich
2026-08-28 23:36:28 +06:00
committed by GitHub
parent c1d1f6b161
commit 5fadea61e7
50 changed files with 328 additions and 251 deletions
@@ -38,6 +38,8 @@ import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -170,12 +172,12 @@ fun DuplicateMangaDialog(
@Composable
private fun DuplicateMangaListItem(
duplicate: MangaWithChapterCount,
getSource: () -> Source,
getSource: suspend () -> Source,
onDismissRequest: () -> Unit,
onOpenManga: () -> Unit,
onMigrate: () -> Unit,
) {
val source = getSource()
val source by produceState<Source?>(initialValue = null) { value = getSource() }
val manga = duplicate.manga
Column(
modifier = Modifier
@@ -277,7 +279,7 @@ private fun DuplicateMangaListItem(
)
}
Text(
text = source.name,
text = source?.name.orEmpty(),
style = MaterialTheme.typography.labelSmall,
overflow = TextOverflow.Ellipsis,
maxLines = 1,