mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-18 05:41:56 +01:00
This should be better than launching a new thread after LaunchedEffect already lauched hers.
This commit is contained in:
parent
f5a1007f88
commit
92d9c682f8
@ -65,6 +65,7 @@ import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
|
||||
import com.vitorpamplona.quartz.events.ImmutableListOfLists
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.Locale
|
||||
|
||||
@Composable
|
||||
@ -367,7 +368,7 @@ fun TranslateAndWatchLanguageChanges(
|
||||
LaunchedEffect(accountState) {
|
||||
// This takes some time. Launches as a Composition scope to make sure this gets cancel if this
|
||||
// item gets out of view.
|
||||
launch(Dispatchers.IO) {
|
||||
withContext(Dispatchers.IO) {
|
||||
LanguageTranslatorService.autoTranslate(
|
||||
content,
|
||||
accountViewModel.account.dontTranslateFrom,
|
||||
|
Loading…
x
Reference in New Issue
Block a user