From 49d5eae66a979596a229ce1ac95cfc7da11e4bf8 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Wed, 12 Sep 2018 13:16:52 +0200 Subject: [PATCH] lib/config: Actually modify config element (fixes #5185) (#5186) --- lib/config/wrapper.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/config/wrapper.go b/lib/config/wrapper.go index 75e35221d..1f19fce4d 100644 --- a/lib/config/wrapper.go +++ b/lib/config/wrapper.go @@ -475,16 +475,16 @@ func (w *Wrapper) AddOrUpdatePendingFolder(id, label string, device protocol.Dev w.mut.Lock() defer w.mut.Unlock() - for _, dev := range w.cfg.Devices { - if dev.DeviceID == device { - for i := range dev.PendingFolders { - if dev.PendingFolders[i].ID == id { - dev.PendingFolders[i].Label = label - dev.PendingFolders[i].Time = time.Now() + for i := range w.cfg.Devices { + if w.cfg.Devices[i].DeviceID == device { + for j := range w.cfg.Devices[i].PendingFolders { + if w.cfg.Devices[i].PendingFolders[j].ID == id { + w.cfg.Devices[i].PendingFolders[j].Label = label + w.cfg.Devices[i].PendingFolders[j].Time = time.Now() return } } - dev.PendingFolders = append(dev.PendingFolders, ObservedFolder{ + w.cfg.Devices[i].PendingFolders = append(w.cfg.Devices[i].PendingFolders, ObservedFolder{ Time: time.Now(), ID: id, Label: label,