From 024b4cd8c8a4a16b2444c5f35e70f734026d6eac Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 14 Jul 2025 08:12:06 +0700 Subject: [PATCH] fix bug allbids histories --- .../models/allbids.com.au/allbids-product-bid.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/auto-bid-tool/models/allbids.com.au/allbids-product-bid.js b/auto-bid-tool/models/allbids.com.au/allbids-product-bid.js index b054fe2..3207fdb 100644 --- a/auto-bid-tool/models/allbids.com.au/allbids-product-bid.js +++ b/auto-bid-tool/models/allbids.com.au/allbids-product-bid.js @@ -72,14 +72,19 @@ export class AllbidsProductBid extends ProductBid { () => window.angular !== undefined ); - const historiesData = await this.page_context.evaluate(() => { + const historiesData = await this.page_context.evaluate((model) => { let data = null; const elements = document.querySelectorAll(".ng-scope"); for (let i = 0; i < elements.length; i++) { try { const scope = angular.element(elements[i]).scope(); - if (scope?.bidHistory) { + if ( + scope && + scope.auction && + scope?.auction.aucID === model && + scope?.bidHistory + ) { data = scope.bidHistory; break; } @@ -96,7 +101,7 @@ export class AllbidsProductBid extends ProductBid { } return data; - }); + }, this.model); return historiesData; } catch (error) {