Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEEDS TESTING: Added lookupDelay with ASUS configuration #2124

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/store/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ async function checkIsCloudflare(store: Store, page: Page, link: Link) {
}

async function lookupCardInStock(store: Store, page: Page, link: Link) {
if (store.lookupDelay) {
await delay(store.lookupDelay);
}

const baseOptions: Selector = {
requireVisible: false,
selector: store.labels.container ?? 'body',
Expand Down
1 change: 1 addition & 0 deletions src/store/model/asus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export const Asus: Store = {
url: 'https://store.asus.com/us/item/202011AM200000003',
},
],
lookupDelay: 3000,
name: 'asus',
realTimeInventoryLookup: async (itemNumber: string) => {
const request_url = 'https://store.asus.com/us/category/get_real_time_data';
Expand Down
1 change: 1 addition & 0 deletions src/store/model/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export type Store = {
urls: Array<{series: Series; url: string | string[]}>;
};
labels: Labels;
lookupDelay: number;
name: string;
currency: '£' | '$' | '€' | 'R$' | 'kr.' | '';
setupAction?: (browser: Browser) => void;
Expand Down