sfbrigade / bats-server

Routed is an app to help ambulances direct non-critical patients to hospital emergency rooms with the most availability.
https://routedapp.org/
GNU Affero General Public License v3.0
18 stars 11 forks source link

ETA not shown correctly in RingdownCard #270

Closed fwextensions closed 1 year ago

fwextensions commented 1 year ago

Looks like I didn't test #267 well enough. The ringdown card shows the "Arrived At" state even though it should still be in the ETA state:

image

These lines are just checking the Status.ARRIVED constant, so they'll always hit the first branch of the ternary:

        label={Status.ARRIVED ? 'Arrived At:' : 'ETA:'}
        time={Status.ARRIVED ? DateTime.fromISO(timestamps.ARRIVED) : etaDateTimeLocalObj}

This should do something like const hasArrived = currentDeliveryStatus === Status.ARRIVED and then check that value in the label and time fields.