use a better user message for network errors
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 6 Jun 2023 16:16:43 +0000 (18:16 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 8 Jun 2023 06:55:32 +0000 (08:55 +0200)
tell users this is a network error and the client wll retry
automatically

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/tray/activitylistmodel.cpp

index 658eb7936928c28b708f913586f6d574623c3615..a917a580a65345934c12d825ef8cca734d9e56b9 100644 (file)
@@ -559,8 +559,12 @@ void ActivityListModel::addEntriesToActivityList(const ActivityList &activityLis
 void ActivityListModel::addErrorToActivityList(const Activity &activity, const ErrorType type)
 {
     qCInfo(lcActivity) << "Error successfully added to the notification list: " << type << activity._message << activity._subject << activity._syncResultStatus << activity._syncFileItemStatus;
-    addEntriesToActivityList({activity});
-    _notificationErrorsLists.prepend(activity);
+    auto modifiedActivity = activity;
+    if (type == ErrorType::NetworkError) {
+        modifiedActivity._subject = tr("Network error occurred: client will retry syncing.");
+    }
+    addEntriesToActivityList({modifiedActivity});
+    _notificationErrorsLists.prepend(modifiedActivity);
 }
 
 void ActivityListModel::addIgnoredFileToList(const Activity &newActivity)