fix: only display the delay when when >0
This commit is contained in:
parent
98373b4063
commit
971e9c84c9
1 changed files with 10 additions and 2 deletions
|
|
@ -41,10 +41,18 @@ fi
|
|||
# Create the tooltip text
|
||||
tooltip="${train_type} ${line_number} (${train_number} - Br${train_series})\n\n"
|
||||
tooltip+="Next stop: ${next_stop_name}\n"
|
||||
if [[ $next_stop_arrival_delay == "" ]]; then
|
||||
tooltip+="${next_stop_arrival_time} - ${distance_km} km"
|
||||
else
|
||||
tooltip+="${next_stop_arrival_time} (${next_stop_arrival_delay}) - ${distance_km} km"
|
||||
fi
|
||||
|
||||
# Create the JSON object
|
||||
if [[ $next_stop_arrival_delay == "" ]]; then
|
||||
text="${speed} km/h - ${next_stop_arrival_time}"
|
||||
else
|
||||
text="${speed} km/h - ${next_stop_arrival_time} (${next_stop_arrival_delay})"
|
||||
fi
|
||||
alt="Current speed"
|
||||
class="icestats"
|
||||
percentage=0
|
||||
|
|
|
|||
Loading…
Reference in a new issue