u
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Component } from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import { StorageManagerContext } from '../../api/storageManagerContext';
|
||||
import { getCategoryState, whenCategoryTreeReady } from '../../automats/categoryAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { bootstrapAuthMe } from '../../automats/authAutomat';
|
||||
import BackendError from '../../components/BackendError';
|
||||
import { ArticleView } from '../../components/article';
|
||||
import {
|
||||
@@ -22,13 +24,11 @@ function ArticleLoading() {
|
||||
}
|
||||
|
||||
class ArtikelSkuPage extends Component {
|
||||
static contextType = StorageManagerContext;
|
||||
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
article: getArticle(props.sku),
|
||||
ready: context.getCategoryState() != null,
|
||||
ready: getCategoryState() != null,
|
||||
error: null,
|
||||
};
|
||||
}
|
||||
@@ -72,9 +72,9 @@ class ArtikelSkuPage extends Component {
|
||||
try {
|
||||
await Promise.all([
|
||||
artikelAutomat.actions.loadArticle(sku),
|
||||
this.context.categoryTreePromise,
|
||||
this.context.companyPromise,
|
||||
this.context.authMePromise,
|
||||
whenCategoryTreeReady(),
|
||||
companyAutomat.actions.load(),
|
||||
bootstrapAuthMe(),
|
||||
]);
|
||||
if (this._mounted) this.setState({ ready: true });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user