Commit 5b6b7c52 authored by Maksym Tishchenko's avatar Maksym Tishchenko
Browse files

Merge branch '402-error-message-when-the-user-adds-an-inventory' into 'main'

Error message when the user adds an inventory

Closes #402

See merge request grin-global/grin-global-ui!394
parents 9ac43037 d794823a
......@@ -174,7 +174,9 @@ class InventoryDetailsPage extends React.Component<PropsFromRedux & IWithTabs &
const { actions, auditLogs, selected, qualityStatus } = this.state;
if (!inventoryCall || !inventoryCall.loading && (!inventoryCall.error && id && +id !== inventoryCall.data.id)) {
getInventoryAction(id);
this.setState({ actions: [], qualityStatus: [], auditLogs: null })
if (actions.length > 0 || qualityStatus.length > 0 || !!auditLogs) {
this.setState({ actions: [], qualityStatus: [], auditLogs: null })
}
}
if (prevState.actions.length === 0 && actions.length === 0 && inventoryCall?.data?.actions.length > 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment