mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-27 05:12:06 +08:00
replay: fixed the status is always "loading" if there is no carState in events (#27481)
old-commit-hash: 6c4320559a
This commit is contained in:
@@ -165,7 +165,10 @@ void ConsoleUI::updateStatus() {
|
||||
sm.update(0);
|
||||
|
||||
if (status != Status::Paused) {
|
||||
status = (sm.updated("carState") || sm.updated("liveParameters")) ? Status::Playing : Status::Waiting;
|
||||
auto events = replay->events();
|
||||
uint64_t current_mono_time = replay->routeStartTime() + replay->currentSeconds() * 1e9;
|
||||
bool playing = !events->empty() && events->back()->mono_time > current_mono_time;
|
||||
status = playing ? Status::Playing : Status::Waiting;
|
||||
}
|
||||
auto [status_str, status_color] = status_text[status];
|
||||
write_item(0, 0, "STATUS: ", status_str, " ", false, status_color);
|
||||
|
||||
Reference in New Issue
Block a user