From da774e10e8deca9ca159b02a34ae6c8ef0dd386f Mon Sep 17 00:00:00 2001 From: Green Sky Date: Mon, 2 Oct 2023 15:40:32 +0200 Subject: [PATCH] update to entt 3.12.2 --- src/chat_gui4.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index 0bc1b2b..fcc1289 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -197,9 +197,9 @@ void ChatGui4::render(void) { msg_reg.remove(to_remove.cbegin(), to_remove.cend()); } - msg_reg.view() - .use() - .each([&](const Message3 e, Message::Components::ContactFrom& c_from, Message::Components::ContactTo& c_to, Message::Components::Timestamp ts + auto tmp_view = msg_reg.view(); + tmp_view.use(); + tmp_view.each([&](const Message3 e, Message::Components::ContactFrom& c_from, Message::Components::ContactTo& c_to, Message::Components::Timestamp ts ) { // TODO: why? ImGui::TableNextRow(0, TEXT_BASE_HEIGHT); @@ -651,8 +651,10 @@ bool ChatGui4::renderContactListContactBig(const Contact3 c, const bool selected // TODO: is there a better way? // maybe cache mm? bool has_unread = false; - if (const auto* mm = _rmm.get(c); mm != nullptr && !mm->storage().empty()) { - has_unread = true; + if (const auto* mm = _rmm.get(c); mm != nullptr) { + if (const auto* unread_storage = mm->storage(); unread_storage != nullptr && !unread_storage->empty()) { + has_unread = true; + } } ImGui::Text("%s%s", has_unread?"* ":"", (_cr.all_of(c) ? _cr.get(c).name.c_str() : ""));