feat: wire sse_client_cpp_core for live updates from /api/boards/issues/stream
This commit is contained in:
+8
-1
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <imgui.h>
|
||||
#include <ctime>
|
||||
#include <mutex>
|
||||
|
||||
namespace kanban_cpp {
|
||||
|
||||
@@ -32,6 +33,12 @@ void draw_calendar(AppState& s, bool* p_open) {
|
||||
ImGui::TextDisabled("(MVP estatico — TODO: navegacion + filtros)");
|
||||
ImGui::Separator();
|
||||
|
||||
std::vector<Card> cards_snap;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s.mu);
|
||||
cards_snap = s.cards;
|
||||
}
|
||||
|
||||
// First day of current month + days in month
|
||||
std::tm tm_first = tm_now;
|
||||
tm_first.tm_mday = 1;
|
||||
@@ -68,7 +75,7 @@ void draw_calendar(AppState& s, bool* p_open) {
|
||||
ImGui::Text("%d", day);
|
||||
// Count cards whose due_date falls in this day.
|
||||
int hits = 0;
|
||||
for (const auto& card : s.cards) {
|
||||
for (const auto& card : cards_snap) {
|
||||
if (card.due_date == 0) continue;
|
||||
std::time_t cd = (std::time_t)card.due_date;
|
||||
std::tm tmc;
|
||||
|
||||
Reference in New Issue
Block a user