fix(android): system back from trip replay returns to the list

This commit is contained in:
Mathieu Moran
2026-08-15 20:37:36 -04:00
parent b775856dd9
commit 26fd915110
@@ -2,6 +2,7 @@ package com.yarisobd.app
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.BackHandler
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
@@ -117,6 +118,20 @@ fun YarisMainScreen(client: OkHttpClient) {
}
}
// System back from a trip replay returns to the list instead of exiting.
BackHandler(enabled = selectedTrip != null || selectedPortalTrip != null) {
when {
selectedTrip != null -> {
selectedTrip = null
tripVm.clearRoute()
}
selectedPortalTrip != null -> {
selectedPortalTrip = null
portalVm.clearRoute()
}
}
}
if (selectedTrip != null) {
TripReplayScreen(
trip = selectedTrip!!,