summary refs log tree commit diff
path: root/src/encryption/SelfVerificationStatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/encryption/SelfVerificationStatus.cpp')
-rw-r--r--src/encryption/SelfVerificationStatus.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/encryption/SelfVerificationStatus.cpp b/src/encryption/SelfVerificationStatus.cpp

index bbfb6f9c..32386fdb 100644 --- a/src/encryption/SelfVerificationStatus.cpp +++ b/src/encryption/SelfVerificationStatus.cpp
@@ -259,15 +259,20 @@ SelfVerificationStatus::invalidate() using namespace mtx::secret_storage; nhlog::db()->info("Invalidating self verification status"); + if (cache::isInitialized()) { + return; + } + this->hasSSSS_ = false; emit hasSSSSChanged(); auto keys = cache::client()->userKeys(http::client()->user_id().to_string()); if (!keys || keys->device_keys.find(http::client()->device_id()) == keys->device_keys.end()) { - cache::client()->markUserKeysOutOfDate({http::client()->user_id().to_string()}); - cache::client()->query_keys(http::client()->user_id().to_string(), - [](const UserKeyCache &, mtx::http::RequestErr) {}); - return; + QTimer::singleShot(500, [] { + cache::client()->markUserKeysOutOfDate({http::client()->user_id().to_string()}); + cache::client()->query_keys(http::client()->user_id().to_string(), + [](const UserKeyCache &, mtx::http::RequestErr) {}); + }); } if (keys->master_keys.keys.empty()) {