|
156 | 156 | Object.entries(versionFilterKeyMap).map(([key, value]) => [value, key])
|
157 | 157 | );
|
158 | 158 |
|
| 159 | + // An internal URL change occurs when we are modifying the URL parameters in a way |
| 160 | + // that should not reload parameters from the URL |
| 161 | + let internalURLChange = false; |
| 162 | + |
159 | 163 | // loadFromURLParameters retrieves filter settings from the URL parameters and assigns them
|
160 | 164 | // to corresponding $scope variables.
|
161 | 165 | function loadFromURLParameters() {
|
|
266 | 270 | }, true);
|
267 | 271 |
|
268 | 272 | // Watch for changes in the URL path and update the search and lint display
|
269 |
| - $scope.$watch(function () { |
270 |
| - return $location.path(); |
271 |
| - }, function (newPath) { |
| 273 | + $scope.$watch($location.path, function (newPath) { |
272 | 274 | const searchParameter = newPath.substring(1);
|
273 | 275 | if ($scope.search !== searchParameter) {
|
274 | 276 | $scope.search = searchParameter;
|
|
290 | 292 | }
|
291 | 293 | });
|
292 | 294 |
|
293 |
| - $scope.$watch(function () { |
294 |
| - return $location.search(); |
295 |
| - }, function (newParameters) { |
296 |
| - loadFromURLParameters(); |
| 295 | + $scope.$watch($location.search, function (newParameters) { |
| 296 | + if (!internalURLChange) { |
| 297 | + loadFromURLParameters(); |
| 298 | + } |
| 299 | + internalURLChange = false; |
297 | 300 | });
|
298 | 301 |
|
299 | 302 | $scope.updatePath = function () {
|
|
331 | 334 | for (const [key, value] of Object.entries(GROUPS_FILTER_DEFAULT)) {
|
332 | 335 | groups[key] = value;
|
333 | 336 | }
|
| 337 | + internalURLChange = true; |
| 338 | + $location.search('groups', null); |
334 | 339 | };
|
335 | 340 |
|
336 | 341 | $scope.selectedValuesCount = function (obj) {
|
|
0 commit comments