u
This commit is contained in:
@@ -238,11 +238,22 @@ class ArtikelKategorienPage extends PureComponent {
|
||||
routeError: view?.error ?? null,
|
||||
});
|
||||
this.subscribeViewHandle();
|
||||
} else if (resolvedId !== resolvedCategoryId) {
|
||||
this.setState({
|
||||
resolvedCategoryId: resolvedId,
|
||||
childCategories: getCategoryChildren(categories, resolvedId),
|
||||
});
|
||||
} else {
|
||||
const view = this.handle?.state;
|
||||
const updates = {};
|
||||
if (resolvedId !== resolvedCategoryId) {
|
||||
updates.resolvedCategoryId = resolvedId;
|
||||
updates.childCategories = view?.data?.childCategories ?? getCategoryChildren(categories, resolvedId);
|
||||
}
|
||||
if (view?.data?.articles && view.data.articles !== this.state.articles) {
|
||||
updates.articles = view.data.articles;
|
||||
}
|
||||
if (Object.keys(updates).length > 0) {
|
||||
this.setState(updates);
|
||||
}
|
||||
if (!this.handle?.loaded && !this.handle?.loading) {
|
||||
void this.handle?.load().catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user