Repository: syncthing/syncthing
File: gui/default/syncthing/core/syncthingController.js (JavaScript)

Code before:
                    && $scope.completion[deviceCfg.deviceID][folderID].remoteState == 'notSharing') {
                    return true;
                }
            }
            return false;
        };

        $scope.deviceHasPausedFolders = function (deviceCfg) {
            if (!(deviceCfg.deviceID in $scope.completion)) {
                return false;
            }
            for (var folderID in $scope.completion[deviceCfg.deviceID]) {
                if (folderID in $scope.folders
                    && $scope.completion[deviceCfg.deviceID][folderID].remoteState == 'paused') {
                    return true;
                }
            }
            return false;
        };

        $scope.deleteFolder = function (id) {
            if ($scope.currentFolder._editing != "existing") {
                return;
            }

            delete $scope.folders[id];
            delete $scope.model[id];
            $scope.config.folders = folderList($scope.folders);
            recalcLocalStateTotal();

            $scope.saveConfig().then(function () {
                hideModal('#editFolder');
            });
        };

        function resetRestoreVersions() {
            $scope.restoreVersions = {
                folder: null,
                selections: {},
                versions: null,
                tree: null,
                errors: null,
                filters: {},
                massAction: function (name, action) {
                    $.each($scope.restoreVersions.versions, function (key) {
                        if (key.indexOf(name + '/') == 0 && (!$scope.restoreVersions.filters.text || key.indexOf($scope.restoreVersions.filters.text) > -1)) {
                            if (action == 'unset') {
                                delete $scope.restoreVersions.selections[key];
                                return;
                            }


Review comment (suggestion):
I have removed this completely as no longer needed (and replaced by the `showModal` and `hideModal` functions).

Code after:

        $scope.deviceHasUnacceptedFolders = function (deviceCfg) {
            if (!(deviceCfg.deviceID in $scope.completion)) {
                return false;
            }
            for (var folderID in $scope.completion[deviceCfg.deviceID]) {
                if (folderID in $scope.folders
                    && $scope.completion[deviceCfg.deviceID][folderID].remoteState == 'notSharing') {
                    return true;
                }
            }
            return false;
        };

        $scope.deviceHasPausedFolders = function (deviceCfg) {
            if (!(deviceCfg.deviceID in $scope.completion)) {
                return false;
            }
            for (var folderID in $scope.completion[deviceCfg.deviceID]) {
                if (folderID in $scope.folders
                    && $scope.completion[deviceCfg.deviceID][folderID].remoteState == 'paused') {
                    return true;
                }
            }
            return false;
        };

        $scope.deleteFolder = function (id) {
            if ($scope.currentFolder._editing != "existing") {
                return;
            }

            delete $scope.folders[id];
            delete $scope.model[id];
            $scope.config.folders = folderList($scope.folders);
            recalcLocalStateTotal();

            $scope.saveConfig().then(function () {
                hideModal('#editFolder');
            });
        };

        function resetRestoreVersions() {
            $scope.restoreVersions = {
                folder: null,
                selections: {},
                versions: null,
                tree: null,
                errors: null,
                filters: {},
                massAction: function (name, action) {