fix: clear shared Production IDs before setting new ones

Fixed material validation always using historical order numbers instead of
current input. The setSharedProductionIds function was accumulating IDs
without clearing old ones, causing validation to use all previously entered
order numbers.

Changes:
- Added sharedProductionIds.clear() before adding new IDs
- Ensures Set only contains the latest order numbers from extractor page

This fixes the root cause where changing the order number in the extractor
page would not update the validation data source, as old IDs were never
removed from the shared Set.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-03-03 10:01:05 +08:00
parent edf696ab39
commit 74ddef2d7b

View File

@@ -35,6 +35,7 @@ const sharedProductionIds = new Set<string>()
* Set shared Production IDs * Set shared Production IDs
*/ */
export function setSharedProductionIds(ids: string[]): void { export function setSharedProductionIds(ids: string[]): void {
sharedProductionIds.clear()
ids.forEach((id) => sharedProductionIds.add(id)) ids.forEach((id) => sharedProductionIds.add(id))
} }