Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-01-08 14:31:31 +02:00
1 parent 51bdfc131b
commit ddf45c2025
8 files changed
+28 -31

No files matched your search

@@ -95,9 +95,8 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
@observable isLoaded = false;
@observable isUnmounting = false;
// default user settings (ui show-hide tweaks mostly)
@observable userSettings: ItemListLayoutUserSettings = {
showAppliedFilters: false,
showAppliedFilters: true,
};
constructor(props: ItemListLayoutProps) {
@@ -140,8 +139,9 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
this.unsubscribeStores();
// load
for (let store of stores) {
for (const store of stores) {
if (this.isUnmounting) break;
try {
store.reset();
await store.loadAll();
@@ -34,14 +34,14 @@ export class PageFiltersStore {
namespaceStore.setContext(filteredNs);
}
}),
reaction(() => namespaceStore.contextNs.toJS(), contextNs => {
namespaceStore.onContextChange(namespaces => {
const filteredNs = this.getValues(FilterType.NAMESPACE);
const isChanged = contextNs.length !== filteredNs.length;
const isChanged = namespaces.length !== filteredNs.length;
if (isChanged) {
this.filters.replace([
...this.filters.filter(({ type }) => type !== FilterType.NAMESPACE),
...contextNs.map(ns => ({ type: FilterType.NAMESPACE, value: ns })),
...namespaces.map(ns => ({ type: FilterType.NAMESPACE, value: ns })),
]);
}
}, {