diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/ExportScreen.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/ExportScreen.kt index 18f7d4d..8b94648 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/ExportScreen.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/ExportScreen.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontFamily import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import net.codinux.banking.dataaccess.entities.AccountTransactionEntity import net.codinux.banking.ui.IOorDefault import net.codinux.banking.ui.config.Colors @@ -35,7 +36,9 @@ fun ExportScreen(onClosed: () -> Unit) { coroutineScope.launch(Dispatchers.IOorDefault) { transactions = DI.bankingService.getAllAccountTransactions() // a only very bit problematic: if in the meantime new transactions are retrieved, then this transactions property doesn't contain the newly retrieved transactions - exportedDataText = importerExporter.exportTransactionsAsCsv(transactions, ',') + withContext(Dispatchers.Main) { + exportedDataText = importerExporter.exportTransactionsAsCsv(transactions, ',') + } } FullscreenViewBase("Umsätze exportieren", onClosed = onClosed) {