diff --git a/src/features/milestones/milestone.tsx b/src/features/milestones/milestone.tsx index c22693c..9056ab2 100644 --- a/src/features/milestones/milestone.tsx +++ b/src/features/milestones/milestone.tsx @@ -59,6 +59,7 @@ export interface MilestoneOptions { export interface BaseMilestone extends Persistent { id: string; earned: Ref; + complete: VoidFunction; type: typeof MilestoneType; [Component]: typeof MilestoneComponent; [GatherProps]: () => Record; @@ -92,6 +93,10 @@ export function createMilestone( milestone[Component] = MilestoneComponent; milestone.earned = milestone[PersistentState]; + milestone.complete = function () { + milestone[PersistentState].value = true; + }; + processComputable(milestone as T, "visibility"); setDefault(milestone, "visibility", Visibility.Visible); const visibility = milestone.visibility as ProcessedComputable;