From 15ba6d58e2572d4cc1fd31894898f99df56a00ee Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 12 Nov 2023 15:53:15 -0500 Subject: [PATCH] Only attempt to setup push notifications on the first syncDone --- src/controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controller.cpp b/src/controller.cpp index 7e89d54c9..ccc7d4bf3 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -98,9 +98,11 @@ Controller::Controller(QObject *parent) if (m_accountRegistry.size() > oldAccountCount) { auto connection = dynamic_cast(m_accountRegistry.accounts()[m_accountRegistry.size() - 1]); connect(connection, &NeoChatConnection::syncDone, this, [this, connection]() { - connection->setupPushNotifications(m_endpoint); NotificationsManager::instance().handleNotifications(connection); }); + connectSingleShot(connection, &NeoChatConnection::syncDone, this, [this, connection] { + connection->setupPushNotifications(m_endpoint); + }); } oldAccountCount = m_accountRegistry.size(); });