Fixed setting exportedDataText on Main dispatcher

This commit is contained in:
dankito 2024-09-01 18:01:44 +02:00
parent 9209347d86
commit 3cff13949e
1 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontFamily
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import net.codinux.banking.dataaccess.entities.AccountTransactionEntity import net.codinux.banking.dataaccess.entities.AccountTransactionEntity
import net.codinux.banking.ui.IOorDefault import net.codinux.banking.ui.IOorDefault
import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.Colors
@ -35,8 +36,10 @@ fun ExportScreen(onClosed: () -> Unit) {
coroutineScope.launch(Dispatchers.IOorDefault) { 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 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
withContext(Dispatchers.Main) {
exportedDataText = importerExporter.exportTransactionsAsCsv(transactions, ',') exportedDataText = importerExporter.exportTransactionsAsCsv(transactions, ',')
} }
}
FullscreenViewBase("Umsätze exportieren", onClosed = onClosed) { FullscreenViewBase("Umsätze exportieren", onClosed = onClosed) {
Column { Column {