Skip to content

Commit

Permalink
refactor: make link labels > store labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed Mar 2, 2021
1 parent 8ee6815 commit f583029
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/store/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,27 +449,27 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
}
}

if (store.labels.inStock) {
if (link.labels?.inStock) {
const options = {
...baseOptions,
requireVisible: true,
type: 'outerHTML' as const,
};

if (!(await pageIncludesLabels(page, store.labels.inStock, options))) {
if (!(await pageIncludesLabels(page, link.labels.inStock, options))) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
}

if (link.labels?.inStock) {
if (store.labels.inStock) {
const options = {
...baseOptions,
requireVisible: true,
type: 'outerHTML' as const,
};

if (!(await pageIncludesLabels(page, link.labels.inStock, options))) {
if (!(await pageIncludesLabels(page, store.labels.inStock, options))) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
Expand Down

0 comments on commit f583029

Please sign in to comment.