ca1ad57f7e3f9bccde75058dbf3fc1a5001dcec2
Added a `SessionState` sealed class to track the connection status and integrated it into the `DashboardScreen`. The dashboard now triggers a session validation on launch, showing a loading indicator during the check. The `MainViewModel` has been updated with a `validateSession` function that: - Pings the server using the stored access token. - Attempts to refresh the token if a 401 Unauthorized response is received. - Updates the `TokenStorage` with new tokens upon successful refresh. - Redirects to logout if both tokens are invalid. Additionally, the `APIService` was expanded with `ping` and `refresh` endpoints, and the `AppDatabase` version was incremented.
Description
Languages
Kotlin
100%