chore: fix

This commit is contained in:
2026-05-01 20:58:51 +02:00
parent 46b287c960
commit b34c239415
12 changed files with 87 additions and 24 deletions
@@ -352,7 +352,14 @@ func StartDelivery(c *gin.Context) {
if clientUsername, _ := command["username"].(string); clientUsername != "" {
var msg string
etaMinutes := 0
if req.Latitude != 0 && req.Longitude != 0 {
if etaData, err := database.GetCommandETA(commandID); err == nil {
if v, ok := etaData["total_eta_minutes"]; ok {
if n, err2 := strconv.Atoi(v); err2 == nil && n > 0 {
etaMinutes = n
}
}
}
if etaMinutes == 0 && req.Latitude != 0 && req.Longitude != 0 {
destLat, _ := command["dest_latitude"].(float64)
destLon, _ := command["dest_longitude"].(float64)
if destLat != 0 && destLon != 0 {