From 9aadd773fb64aabf2dd48181b4ed19327cb668ad Mon Sep 17 00:00:00 2001 From: James Graham Date: Sun, 24 Nov 2024 12:48:21 +0000 Subject: [PATCH] Check m_accountsLoading and m_connectionsLoading separately for removal as when loadAccessTokenFromKeyChain() fails m_connectionsLoading won't have an entry for it --- src/controller.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index 3ec93b6cf..4c54896a7 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -423,10 +423,14 @@ void Controller::setTestMode(bool test) void Controller::removeConnection(const QString &userId) { - if (m_connectionsLoading.contains(userId) && m_connectionsLoading[userId]) { - auto connection = m_connectionsLoading[userId]; + // When loadAccessTokenFromKeyChain() fails m_connectionsLoading won't have an + // entry for it so we need to check both separately. + if (m_accountsLoading.contains(userId)) { m_accountsLoading.removeAll(userId); Q_EMIT accountsLoadingChanged(); + } + if (m_connectionsLoading.contains(userId) && m_connectionsLoading[userId]) { + auto connection = m_connectionsLoading[userId]; SettingsGroup("Accounts"_ls).remove(userId); } }