fix(nav): restore broken traceroute map navigation (#5104)

This commit is contained in:
James Rich 2026-04-13 07:25:21 -05:00 committed by GitHub
parent 35bf1fded5
commit 39620d063b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 71 additions and 6 deletions

View file

@ -277,7 +277,6 @@ open class MetricsViewModel(
responseLogUuid: String,
overlay: TracerouteOverlay?,
onViewOnMap: (Int, String) -> Unit,
onShowError: (StringResource) -> Unit,
) {
viewModelScope.launch {
val snapshotPositions = tracerouteSnapshotRepository.getSnapshotPositions(responseLogUuid).first()
@ -300,7 +299,11 @@ open class MetricsViewModel(
)
val errorRes = availability.toMessageRes()
if (errorRes != null) {
onShowError(errorRes)
// Post the error alert after the current alert is dismissed to avoid
// the wrapping dismissAlert() in AlertManager immediately clearing it.
viewModelScope.launch {
alertManager.showAlert(titleRes = Res.string.traceroute, messageRes = errorRes)
}
} else {
onViewOnMap(requestId, responseLogUuid)
}

View file

@ -361,7 +361,6 @@ private fun showTracerouteDetail(
responseLogUuid = result.uuid,
overlay = overlay,
onViewOnMap = onViewOnMap,
onShowError = {},
)
}