refactor: make link labels > store labels

This commit is contained in:
Jef LeCompte
2021-03-02 11:53:53 -05:00
parent 8ee6815c0f
commit f583029bf3
+13 -13
View File
@@ -449,19 +449,6 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
}
}
if (store.labels.inStock) {
const options = {
...baseOptions,
requireVisible: true,
type: 'outerHTML' as const,
};
if (!(await pageIncludesLabels(page, store.labels.inStock, options))) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
}
if (link.labels?.inStock) {
const options = {
...baseOptions,
@@ -475,6 +462,19 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
}
}
if (store.labels.inStock) {
const options = {
...baseOptions,
requireVisible: true,
type: 'outerHTML' as const,
};
if (!(await pageIncludesLabels(page, store.labels.inStock, options))) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
}
return true;
}