mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
refactor: make link labels > store labels
This commit is contained in:
+13
-13
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user