Compare commits

...
4 changed files with 26 additions and 5 deletions
+2 -2
View File
@@ -213,10 +213,10 @@
</div>
<div class="panel-footer clearfix">
<div class="pull-right">
<button type="button" class="btn btn-sm btn-success" ng-click="addFolderAndShare(pendingFolder.id, pendingFolder.label, pendingFolder.deviceID)" ng-if="!folders[pendingFolder.id]">
<button type="button" class="btn btn-sm btn-success" ng-click="addFolderAndShare(pendingFolder.id, pendingFolder.label, device.deviceID)" ng-if="!folders[pendingFolder.id]">
<span class="fas fa-check"></span>&nbsp;<span translate>Add</span>
</button>
<button type="button" class="btn btn-sm btn-success" ng-click="shareFolderWithDevice(pendingFolder.id, pendingFolder.deviceID)" ng-if="folders[pendingFolder.id]">
<button type="button" class="btn btn-sm btn-success" ng-click="shareFolderWithDevice(pendingFolder.id, device.deviceID)" ng-if="folders[pendingFolder.id]">
<span class="fas fa-check"></span>&nbsp;<span translate>Share</span>
</button>
<button type="button" class="btn btn-sm btn-danger" ng-click="ignoreFolder(device.deviceID, pendingFolder)">
@@ -1388,7 +1388,9 @@ angular.module('syncthing.core')
_addressesStr: 'dynamic',
compression: 'metadata',
introducer: false,
selectedFolders: {}
selectedFolders: {},
pendingFolders: [],
ignoredFolders: []
};
$scope.editingExisting = false;
$scope.deviceEditor.$setPristine();
+20
View File
@@ -1073,6 +1073,26 @@ func TestFilterURLSchemePrefix(t *testing.T) {
}
}
func TestDeviceConfigObservedNotNil(t *testing.T) {
cfg := Configuration{
Devices: []DeviceConfiguration{
{},
},
}
cfg.prepare(device1)
for _, dev := range cfg.Devices {
if dev.IgnoredFolders == nil {
t.Errorf("Ignored folders nil")
}
if dev.PendingFolders == nil {
t.Errorf("Pending folders nil")
}
}
}
// defaultConfigAsMap returns a valid default config as a JSON-decoded
// map[string]interface{}. This is useful to override random elements and
// re-encode into JSON.
+1 -2
View File
@@ -2044,7 +2044,7 @@ func (m *Model) internalScanFolderSubdirs(ctx context.Context, folder string, su
batch := newFileInfoBatch(func(fs []protocol.FileInfo) error {
if err := runner.CheckHealth(); err != nil {
l.Debugln("Stopping scan of folder %s due to: %s", folderCfg.Description(), err)
l.Debugf("Stopping scan of folder %s due to: %s", folderCfg.Description(), err)
return err
}
m.updateLocalsFromScanning(folder, fs)
@@ -2081,7 +2081,6 @@ func (m *Model) internalScanFolderSubdirs(ctx context.Context, folder string, su
// Do a scan of the database for each prefix, to check for deleted and
// ignored files.
batch.reset()
var toIgnore []db.FileInfoTruncated
ignoredParent := ""
pathSep := string(fs.PathSeparator)