fix: settings "Cancel" button doesn't work first time (#5229)

This commit is contained in:
pajlada
2024-03-09 12:29:25 +01:00
committed by GitHub
parent c50791972d
commit 2e77b47ea1
5 changed files with 9 additions and 16 deletions
+5
View File
@@ -8,6 +8,7 @@
#include "controllers/ignores/IgnorePhrase.hpp"
#include "controllers/moderationactions/ModerationAction.hpp"
#include "controllers/nicknames/Nickname.hpp"
#include "debug/Benchmark.hpp"
#include "util/Clamp.hpp"
#include "util/PersistSignalVector.hpp"
#include "util/WindowsHelper.hpp"
@@ -195,6 +196,8 @@ Settings::~Settings()
void Settings::saveSnapshot()
{
BenchmarkGuard benchmark("Settings::saveSnapshot");
rapidjson::Document *d = new rapidjson::Document(rapidjson::kObjectType);
rapidjson::Document::AllocatorType &a = d->GetAllocator();
@@ -230,6 +233,8 @@ void Settings::restoreSnapshot()
return;
}
BenchmarkGuard benchmark("Settings::restoreSnapshot");
const auto &snapshot = *(this->snapshot_.get());
if (!snapshot.IsObject())