This commit is contained in:
seb
2026-10-04 09:21:45 +02:00
parent 4edd417dab
commit da318223c1
8 changed files with 315 additions and 166 deletions

View File

@@ -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(() => {});
}
}
};