diff --git a/src/features/repeatable.tsx b/src/features/repeatable.tsx index 34ce057..ddfe965 100644 --- a/src/features/repeatable.tsx +++ b/src/features/repeatable.tsx @@ -39,8 +39,8 @@ export type RepeatableDisplay = export interface RepeatableOptions { visibility?: Computable; requirements: Requirements; - purchaseLimit?: Computable; - initialValue?: DecimalSource; + limit?: Computable; + initialAmount?: DecimalSource; classes?: Computable>; style?: Computable; mark?: Computable; @@ -67,7 +67,7 @@ export type Repeatable = Replace< { visibility: GetComputableTypeWithDefault; requirements: GetComputableType; - purchaseLimit: GetComputableTypeWithDefault; + limit: GetComputableTypeWithDefault; classes: GetComputableType; style: GetComputableType; mark: GetComputableType; @@ -81,7 +81,7 @@ export type GenericRepeatable = Replace< Repeatable, { visibility: ProcessedComputable; - purchaseLimit: ProcessedComputable; + limit: ProcessedComputable; } >; @@ -97,12 +97,12 @@ export function createRepeatable( repeatable[Component] = ClickableComponent; repeatable.amount = amount; - repeatable.amount[DefaultValue] = repeatable.initialValue ?? 0; + repeatable.amount[DefaultValue] = repeatable.initialAmount ?? 0; const limitRequirement = { requirementMet: computed(() => Decimal.sub( - unref((repeatable as GenericRepeatable).purchaseLimit), + unref((repeatable as GenericRepeatable).limit), (repeatable as GenericRepeatable).amount.value ) ), @@ -124,7 +124,7 @@ export function createRepeatable( repeatable.maxed = computed(() => Decimal.gte( (repeatable as GenericRepeatable).amount.value, - unref((repeatable as GenericRepeatable).purchaseLimit) + unref((repeatable as GenericRepeatable).limit) ) ); processComputable(repeatable as T, "classes"); @@ -182,12 +182,12 @@ export function createRepeatable( {currDisplay.showAmount === false ? null : (

- {unref(genericRepeatable.purchaseLimit) === Decimal.dInf ? ( + {unref(genericRepeatable.limit) === Decimal.dInf ? ( <>Amount: {formatWhole(genericRepeatable.amount.value)} ) : ( <> Amount: {formatWhole(genericRepeatable.amount.value)} /{" "} - {formatWhole(unref(genericRepeatable.purchaseLimit))} + {formatWhole(unref(genericRepeatable.limit))} )}
@@ -217,8 +217,8 @@ export function createRepeatable( processComputable(repeatable as T, "visibility"); setDefault(repeatable, "visibility", Visibility.Visible); - processComputable(repeatable as T, "purchaseLimit"); - setDefault(repeatable, "purchaseLimit", Decimal.dInf); + processComputable(repeatable as T, "limit"); + setDefault(repeatable, "limit", Decimal.dInf); processComputable(repeatable as T, "style"); processComputable(repeatable as T, "mark"); processComputable(repeatable as T, "small");