From 016d47b9d7801613c17059269cdda4b8299f0c8d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 18 Feb 2024 14:02:21 +0100 Subject: [PATCH] web: Make sure settings are loaded correctly --- lib/libimhex/source/api/content_registry.cpp | 8 ++++++++ .../source/content/data_processor_nodes/other_nodes.cpp | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index fdba2a759..d32295cf4 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -66,6 +66,14 @@ namespace hex { } else { s_settings = nlohmann::json::parse(data); } + + for (const auto &[category, rest] : *impl::s_onChangeCallbacks) { + for (const auto &[name, callbacks] : rest) { + for (const auto &[id, callback] : callbacks) { + callback(getSetting(category, name, {})); + } + } + } } void store() { diff --git a/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp index b75c71958..63d2799d5 100644 --- a/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp @@ -390,10 +390,8 @@ namespace hex::plugin::builtin { if (outVars.contains(m_name)) { std::visit(wolv::util::overloaded { - [this](const std::string &) { - }, - [this](const std::shared_ptr &) { - }, + [](const std::string &) {}, + [](const std::shared_ptr &) {}, [this](auto &&value) { std::vector buffer(std::min(sizeof(value), 8)); std::memcpy(buffer.data(), &value, buffer.size());