mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
fix datasaved being called too late
This commit is contained in:
parent
4ad9c848c0
commit
8615bbd52f
1 changed files with 3 additions and 3 deletions
|
@ -225,6 +225,9 @@ Result<> Mod::Impl::saveData() {
|
|||
matjson::Value json = m_savedSettingsData;
|
||||
m_settings->save(json);
|
||||
|
||||
// saveData is expected to be synchronous, and always called from GD thread
|
||||
ModStateEvent(m_self, ModEventType::DataSaved).post();
|
||||
|
||||
auto res = utils::file::writeString(m_saveDirPath / "settings.json", json.dump());
|
||||
if (!res) {
|
||||
log::error("Unable to save settings: {}", res.unwrapErr());
|
||||
|
@ -234,9 +237,6 @@ Result<> Mod::Impl::saveData() {
|
|||
log::error("Unable to save values: {}", res2.unwrapErr());
|
||||
}
|
||||
|
||||
// saveData is expected to be synchronous, and always called from GD thread
|
||||
ModStateEvent(m_self, ModEventType::DataSaved).post();
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue