mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00: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 })),
|
||||
]);
|
||||
}
|
||||
}, {
|
||||
|
||||
Reference in new issue
Block a user