Skip to content

Commit

Permalink
web: Make sure settings are loaded correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 18, 2024
1 parent 1bf1a56 commit 016d47b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions lib/libimhex/source/api/content_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<pl::ptrn::Pattern> &) {
},
[](const std::string &) {},
[](const std::shared_ptr<pl::ptrn::Pattern> &) {},
[this](auto &&value) {
std::vector<u8> buffer(std::min<size_t>(sizeof(value), 8));
std::memcpy(buffer.data(), &value, buffer.size());
Expand Down

0 comments on commit 016d47b

Please sign in to comment.