From caddba5b81a227a3369343899569e4286989b551 Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Sun, 27 Sep 2026 17:07:02 +0800 Subject: [PATCH] fix(settings): load LoTW certificate status at startup The LoTW upload card read uiState.lotwCertificate which was only populated when the config dialog was opened (LoadLoTWUploadStatus). On first entry to the settings screen it stayed null, showing 'certificate not imported' even though a certificate was stored. Load certificate + station once in init so the card is correct from the first frame. --- .../rtbishop/look4sat/feature/settings/SettingsViewModel.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsViewModel.kt b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsViewModel.kt index 28fdc047..c7f2123d 100644 --- a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsViewModel.kt +++ b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsViewModel.kt @@ -163,6 +163,10 @@ class SettingsViewModel( _uiState.update { it.copy(logbookRecords = records) } } } + // Load the LoTW upload certificate + station once at startup so the + // settings card reflects the real state on first frame (previously it + // stayed "not imported" until the config dialog was opened). + loadLoTWUploadStatus() }