[fix] handle missing length widget in API node pricing

Updates pricing logic to show 5s pricing when length widget is removed, while maintaining future-proof support for when the widget is added back.
This commit is contained in:
bymyself
2025-07-07 16:36:09 -07:00
parent 4eeff5533a
commit e770b81df9

View File

@@ -954,7 +954,8 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
(w) => w.name === 'length'
) as IComboWidget
if (!lengthWidget) return '$1.50-3.00/Run (varies with length)'
// If no length widget exists, default to 5s pricing
if (!lengthWidget) return '$1.50/Run'
const length = String(lengthWidget.value)
if (length === '5s') {
@@ -972,7 +973,8 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
(w) => w.name === 'length'
) as IComboWidget
if (!lengthWidget) return '$1.50-3.00/Run (varies with length)'
// If no length widget exists, default to 5s pricing
if (!lengthWidget) return '$1.50/Run'
const length = String(lengthWidget.value)
if (length === '5s') {
@@ -990,7 +992,8 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
(w) => w.name === 'length'
) as IComboWidget
if (!lengthWidget) return '$2.00-4.00/Run (varies with length)'
// If no length widget exists, default to 5s pricing
if (!lengthWidget) return '$2.00/Run'
const length = String(lengthWidget.value)
if (length === '5s') {