diff --git a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/ConnectivityTracker.kt b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/ConnectivityTracker.kt index e34db40c..06241dbe 100644 --- a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/ConnectivityTracker.kt +++ b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/ConnectivityTracker.kt @@ -9,6 +9,7 @@ import kotlinx.coroutines.flow.asStateFlow import org.koin.core.component.KoinComponent import org.koin.core.component.inject import org.koin.core.qualifier.named +import kotlin.time.Duration.Companion.milliseconds /** * Überwacht die Konnektivität zum API-Gateway. @@ -28,7 +29,7 @@ class ConnectivityTracker : KoinComponent { scope.launch { while (isActive) { _isOnline.value = checkConnection() - delay(10_000) // Alle 10 Sekunden prüfen + delay(10_000.milliseconds) // Alle 10 Sekunden prüfen } } } @@ -37,7 +38,7 @@ class ConnectivityTracker : KoinComponent { return try { val response = client.get(NetworkConfig.baseUrl.trimEnd('/') + "/api/ping/health") response.status.value in 200..299 - } catch (e: Exception) { + } catch (_: Exception) { false } } diff --git a/frontend/shells/meldestelle-desktop/src/jvmMain/kotlin/at/mocode/desktop/v2/VeranstaltungScreens.kt b/frontend/shells/meldestelle-desktop/src/jvmMain/kotlin/at/mocode/desktop/v2/VeranstaltungScreens.kt index 349a0a2c..fc59935e 100644 --- a/frontend/shells/meldestelle-desktop/src/jvmMain/kotlin/at/mocode/desktop/v2/VeranstaltungScreens.kt +++ b/frontend/shells/meldestelle-desktop/src/jvmMain/kotlin/at/mocode/desktop/v2/VeranstaltungScreens.kt @@ -29,6 +29,7 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import javax.swing.JFileChooser import javax.swing.filechooser.FileNameExtensionFilter +import kotlin.time.Duration.Companion.milliseconds @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -541,12 +542,12 @@ fun VeranstaltungKonfigV2( val dateVon = try { LocalDate.parse(von, dateFormatter) - } catch (e: Exception) { + } catch (_: Exception) { null } val dateBis = try { LocalDate.parse(bis, dateFormatter) - } catch (e: Exception) { + } catch (_: Exception) { null } val today = LocalDate.now() @@ -728,12 +729,12 @@ fun VeranstaltungKonfigV2( 2 -> { val dVon = try { LocalDate.parse(von, dateFormatter) - } catch (e: Exception) { + } catch (_: Exception) { null } val dBis = try { LocalDate.parse(bis, dateFormatter) - } catch (e: Exception) { + } catch (_: Exception) { null } val today2 = LocalDate.now() @@ -1086,12 +1087,12 @@ fun TurnierWizardV2( val vBis = veranstaltung?.datumBis?.let { LocalDate.parse(it) } val tVon = try { LocalDate.parse(von) - } catch (e: Exception) { + } catch (_: Exception) { null } val tBis = if (bis.isBlank()) tVon else try { LocalDate.parse(bis) - } catch (e: Exception) { + } catch (_: Exception) { null } @@ -1267,7 +1268,7 @@ private fun Step1Basics( CircularProgressIndicator() LaunchedEffect(Unit) { - kotlinx.coroutines.delay(2000) + kotlinx.coroutines.delay(2000.milliseconds) onZnsDataLoadedChange(true) showImportProgress = false } @@ -1295,12 +1296,12 @@ private fun Step2Sparten( val vBis = veranstaltung?.datumBis?.let { LocalDate.parse(it) } val tVon = try { LocalDate.parse(von) - } catch (e: Exception) { + } catch (_: Exception) { null } val tBis = if (bis.isBlank()) tVon else try { LocalDate.parse(bis) - } catch (e: Exception) { + } catch (_: Exception) { null }