Repository: syncthing/syncthing (language: go)

Issue:
"ReferenceError: currentFolder is not defined" errors in the GUI
The console log is filled with these on the current `main` (`v1.19.0-rc.2.dev.13.g635085d1`).

**Edit**: The ignore patterns tab in the edit folder modal is empty.

![image](https://user-images.githubusercontent.com/5626656/151829469-bf6216ce-d53b-49c1-b27c-fb0c8ca8870e.png)

```
ReferenceError: currentFolder is not defined
    at Scope.$scope.editingFolderNew (syncthingController.js:2030:55)
    at Object.$parseFunctionCall [as get] (angular.js:12493:18)
    at Scope.$digest (angular.js:14423:40)
    at Scope.$apply (angular.js:14694:24)
    at angular.js:14984:22
    at completeOutstandingRequest (angular.js:4959:10)
    at angular.js:5347:7
```


Discussion / hints:

Fix patch:
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 65b0c05d729..c60bde0b717 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -2027,7 +2027,7 @@ angular.module('syncthing.core')
         }
 
         $scope.editingFolderNew = function() {
-            return $scope.has(['new', 'new-pending'], currentFolder._editing);
+            return $scope.has(['new', 'new-pending'], $scope.currentFolder._editing);
         }
 
         function editFolder(initialTab) {


Test patch: