Properly save expanded state

This commit is contained in:
crschnick
2025-11-11 16:18:13 +00:00
parent ad81c16eb2
commit aca5cc2bf0

View File

@@ -74,10 +74,19 @@ public abstract class StorageElement {
public void setExpanded(boolean expanded) {
var changed = expanded != this.expanded;
this.expanded = expanded;
if (changed) {
notifyUpdate(false, false);
if (!changed) {
return;
}
this.expanded = expanded;
// Update state but don't register updated time for expanded change
this.dirty = true;
synchronized (listeners) {
listeners.forEach(l -> l.onUpdate());
}
// Save changes instantly
DataStorage.get().saveAsync();
}
public abstract Path[] getShareableFiles();