Update desktopEnterpriseChannel value when capabilities change.
authorCamila Ayres <hello@camilasan.com>
Wed, 3 Jul 2024 13:16:56 +0000 (15:16 +0200)
committerCamila Ayres <hello@camilasan.com>
Thu, 4 Jul 2024 08:16:40 +0000 (10:16 +0200)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/libsync/account.cpp
src/libsync/account.h

index b3e997c2c076f8899ee80540ca88f67e4505efd5..1a05650edad37f9cbd98e6d987c004557edee86e 100644 (file)
@@ -690,6 +690,7 @@ void Account::setCapabilities(const QVariantMap &caps)
 
     updateServerColors();
     updateServerSubcription();
+    updateDesktopEnterpriseChannel();
 
     emit capabilitiesChanged();
 
@@ -1078,5 +1079,14 @@ void Account::updateServerSubcription()
     }
 }
 
+void Account::updateDesktopEnterpriseChannel()
+{
+    ConfigFile currentConfig;
+    if (const auto desktopEnterpriseChannel = _capabilities.desktopEnterpriseChannel();
+        desktopEnterpriseChannel != currentConfig.desktopEnterpriseChannel()) {
+        currentConfig.setDesktopEnterpriseChannel(desktopEnterpriseChannel);
+    }
+}
+
 
 } // namespace OCC
index 1a5afc4091ca177dc25073db845df579850a4b8f..ea371c8ede21e1fff1a18b406a76940116e9001b 100644 (file)
@@ -336,6 +336,7 @@ public:
     [[nodiscard]] bool askUserForMnemonic() const;
 
     void updateServerSubcription();
+    void updateDesktopEnterpriseChannel();
 
 public slots:
     /// Used when forgetting credentials