mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix category move updates
This commit is contained in:
parent
d7527b40e6
commit
a565c795cf
3 changed files with 11 additions and 0 deletions
|
@ -281,6 +281,13 @@ public class StoreViewState {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEntryCategoryChange(DataStoreCategory from, DataStoreCategory to) {
|
||||||
|
synchronized (this) {
|
||||||
|
categories.getList().forEach(storeCategoryWrapper -> storeCategoryWrapper.update());
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -350,9 +350,11 @@ public abstract class DataStorage {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var oldCat = getStoreCategoryIfPresent(entry.getCategoryUuid()).orElse(getDefaultConnectionsCategory());
|
||||||
entry.setCategoryUuid(newCategory.getUuid());
|
entry.setCategoryUuid(newCategory.getUuid());
|
||||||
var children = getDeepStoreChildren(entry);
|
var children = getDeepStoreChildren(entry);
|
||||||
children.forEach(child -> child.setCategoryUuid(newCategory.getUuid()));
|
children.forEach(child -> child.setCategoryUuid(newCategory.getUuid()));
|
||||||
|
listeners.forEach(storageListener -> storageListener.onEntryCategoryChange(oldCat, newCategory));
|
||||||
listeners.forEach(storageListener -> storageListener.onStoreListUpdate());
|
listeners.forEach(storageListener -> storageListener.onStoreListUpdate());
|
||||||
saveAsync();
|
saveAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,6 @@ public interface StorageListener {
|
||||||
void onCategoryAdd(DataStoreCategory category);
|
void onCategoryAdd(DataStoreCategory category);
|
||||||
|
|
||||||
void onCategoryRemove(DataStoreCategory category);
|
void onCategoryRemove(DataStoreCategory category);
|
||||||
|
|
||||||
|
void onEntryCategoryChange(DataStoreCategory from, DataStoreCategory to);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue