fix: settings "Cancel" button doesn't work first time (#5229)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user