u
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
import categoryAutomat from '../../automats/categoryAutomat';
|
||||
import posterminalAutomat from '../../automats/posterminalAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { setLastArticleSku } from '../../automats';
|
||||
import { setLastArticleSku, setLastCategorySlug } from '../../automats';
|
||||
import {
|
||||
categoryDisplayName,
|
||||
getCategoryBreadcrumbs,
|
||||
@@ -98,6 +98,7 @@ class ArtikelKategorienPage extends PureComponent {
|
||||
|
||||
componentDidMount() {
|
||||
setLastArticleSku(null);
|
||||
setLastCategorySlug(this.props.categorySlugPath);
|
||||
this._unsubCat = categoryAutomat.subscribe(this, selectFromCategory);
|
||||
this._unsubTerm = posterminalAutomat.subscribe(this, selectTerminals);
|
||||
this._unsubCompany = companyAutomat.subscribe(this, (s) => ({
|
||||
@@ -110,6 +111,9 @@ class ArtikelKategorienPage extends PureComponent {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (this.props.categorySlugPath !== prevProps.categorySlugPath) {
|
||||
setLastCategorySlug(this.props.categorySlugPath);
|
||||
}
|
||||
if (this.state.companyId !== prevState.companyId) {
|
||||
this.ensureTreeLoaded();
|
||||
}
|
||||
@@ -132,6 +136,7 @@ class ArtikelKategorienPage extends PureComponent {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
setLastCategorySlug(this.props.categorySlugPath);
|
||||
this._unsubCat?.();
|
||||
this._unsubTerm?.();
|
||||
this._unsubCompany?.();
|
||||
|
||||
Reference in New Issue
Block a user