Skip to content

Commit

Permalink
fix: repair data refresh on product pages (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi authored May 3, 2021
1 parent 5b819db commit 8eaac04
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/core/facades/product-context.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,18 @@ export class ProductContextFacade extends RxState<ProductContext> {
);
}

private get isMaximumLevel(): boolean {
return (
this.get('requiredCompletenessLevel') === ProductCompletenessLevel.Detail ||
this.get('requiredCompletenessLevel') === true
);
}

private postProductFetch(product: ProductView, displayProperties: Partial<ProductContextDisplayProperties>) {
if (
(ProductHelper.isRetailSet(product) || ProductHelper.isMasterProduct(product)) &&
displayProperties.price &&
this.get('requiredCompletenessLevel') !== ProductCompletenessLevel.Detail
!this.isMaximumLevel
) {
this.set('requiredCompletenessLevel', () => ProductCompletenessLevel.Detail);
}
Expand Down

0 comments on commit 8eaac04

Please sign in to comment.