From 5595113074a47c84d47d1774cd954e499fb31f58 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 16 Sep 2025 16:01:17 +0000 Subject: [PATCH] fix(gui): don't fetch usage report preview unnecessarily on GUI load (#10395) IMHO the logic here was inverted. The only use for the report data is to show a preview when we ask the user whether they want to participate in usage reporting. However, the GUI would first load the report data and then consider whether we wanted to show that dialog or not. Instead, only load if it we're going to show the dialog. Signed-off-by: Jakob Borg --- gui/default/syncthing/core/syncthingController.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 0ae7102af..ec0ab482f 100644 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -187,13 +187,14 @@ angular.module('syncthing.core') $scope.version = data; }).error($scope.emitHTTPError); - $http.get(urlbase + '/svc/report').success(function (data) { - $scope.reportData = data; - if ($scope.system && $scope.config.options.urAccepted > -1 && $scope.config.options.urSeen < $scope.system.urVersionMax && $scope.config.options.urAccepted < $scope.system.urVersionMax) { - // Usage reporting format has changed, prompt the user to re-accept. + if ($scope.system && $scope.config.options.urAccepted > -1 && $scope.config.options.urSeen < $scope.system.urVersionMax && $scope.config.options.urAccepted < $scope.system.urVersionMax) { + // Usage reporting decision has not been taken or format + // has changed, prompt the user to (re-)accept. + $http.get(urlbase + '/svc/report').success(function (data) { + $scope.reportData = data; showModal('#ur'); - } - }).error($scope.emitHTTPError); + }).error($scope.emitHTTPError); + } $http.get(urlbase + '/system/upgrade').success(function (data) { $scope.upgradeInfo = data;