fix(android): system back from trip replay returns to the list
This commit is contained in:
@@ -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!!,
|
||||
|
||||
Reference in New Issue
Block a user