Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
AlicjaSzu committed May 15, 2020
1 parent 4092559 commit 501513e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Completely recreate checkout and cart, with new checkout nad cart SDK - #639 by @orzechdev, @mateuszkula
- Hide payment options - #678 by @orzechdev
- Fix unhandled JWT token expiration - #696 by @orzechdev
- Implement PDP url for product variant - #708 by @AlicjaSzu

## 0.7.0

Expand Down
39 changes: 20 additions & 19 deletions src/views/Product/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,20 @@ const PageWithQueryAttributes: React.FC<IProps> = props => {
const attributeId = attribute.id;
const selectedAttributeValue = searchQueryAttributes[attribute.slug];
if (selectedAttributeValue) {
values.forEach(({ value }) => {
if (
(value === selectedAttributeValue &&
isEmpty(queryAttributes)) ||
attributes.some(
({ attribute: { id }, values }) =>
queryAttributes[id] &&
queryAttributes[id] === values[0].value
)
) {
queryAttributes = {
...queryAttributes,
[attributeId]: selectedAttributeValue,
};
}
});
if (
(values[0].value === selectedAttributeValue &&
isEmpty(queryAttributes)) ||
attributes.some(
({ attribute: { id }, values }) =>
!!queryAttributes[id] &&
queryAttributes[id] === values[0].value
)
) {
queryAttributes = {
...queryAttributes,
[attributeId]: selectedAttributeValue,
};
}
}
});
});
Expand All @@ -114,9 +112,12 @@ const PageWithQueryAttributes: React.FC<IProps> = props => {

const View: React.FC<RouteComponentProps<{ id: string }>> = ({ match }) => {
const { addItem, items } = useCart();
const { data: product } = useProductDetails({
id: getGraphqlIdFromDBId(match.params.id, "Product"),
});
const { data: product } = useProductDetails(
{
id: getGraphqlIdFromDBId(match.params.id, "Product"),
},
{ errorPolicy: "all" }
);

return (
<NetworkStatus>
Expand Down

0 comments on commit 501513e

Please sign in to comment.