Fix market JSON dump: was guarded by priceToBeatState.value === null but latching at line 589-595 sets value before line 622 check runs. JSON files never written. Remove the broken guard; dumpedMarkets.has(slug) already ensures once-per-market.

This commit is contained in:
2026-07-21 18:30:18 +08:00
parent ee2ab5dda4
commit 4505c1155b
+1 -1
View File
@@ -619,7 +619,7 @@ async function main() {
const currentPriceValue = currentPriceBaseLine.split(": ")[1] ?? currentPriceBaseLine; const currentPriceValue = currentPriceBaseLine.split(": ")[1] ?? currentPriceBaseLine;
const currentPriceLine = kv("CURRENT PRICE:", `${currentPriceValue} (${ptbDeltaText})`); const currentPriceLine = kv("CURRENT PRICE:", `${currentPriceValue} (${ptbDeltaText})`);
if (poly.ok && poly.market && priceToBeatState.value === null) { if (poly.ok && poly.market) {
const slug = safeFileSlug(poly.market.slug || poly.market.id || "market"); const slug = safeFileSlug(poly.market.slug || poly.market.id || "market");
if (slug && !dumpedMarkets.has(slug)) { if (slug && !dumpedMarkets.has(slug)) {
dumpedMarkets.add(slug); dumpedMarkets.add(slug);