fix(lookup): check out of stock before price (#1422)

This commit is contained in:
carrierfry
2020-12-15 15:27:05 +01:00
committed by GitHub
parent ca59777917
commit 02d29c3c64
+9 -9
View File
@@ -347,6 +347,15 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
} }
} }
if (store.labels.outOfStock) {
if (
await pageIncludesLabels(page, store.labels.outOfStock, baseOptions)
) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
}
if (store.labels.maxPrice) { if (store.labels.maxPrice) {
const maxPrice = config.store.maxPrice.series[link.series]; const maxPrice = config.store.maxPrice.series[link.series];
@@ -367,15 +376,6 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
// return store.realTimeInventoryLookup(link.itemNumber); // return store.realTimeInventoryLookup(link.itemNumber);
// } // }
if (store.labels.outOfStock) {
if (
await pageIncludesLabels(page, store.labels.outOfStock, baseOptions)
) {
logger.info(Print.outOfStock(link, store, true));
return false;
}
}
if (store.labels.inStock) { if (store.labels.inStock) {
const options = { const options = {
...baseOptions, ...baseOptions,