From 8d0489c8e18f48b80b391cbf427867994e2238ba Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 22 Mar 2022 23:04:49 -0500 Subject: [PATCH] Default Challenge.canStart to true --- src/features/challenges/Challenge.vue | 8 ++++++-- src/features/challenges/challenge.tsx | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/challenges/Challenge.vue b/src/features/challenges/Challenge.vue index 7960607..f98aa0a 100644 --- a/src/features/challenges/Challenge.vue +++ b/src/features/challenges/Challenge.vue @@ -12,12 +12,16 @@ feature: true, challenge: true, done: unref(completed), - canStart: unref(canStart), + canStart: unref(canStart) && !unref(maxed), maxed: unref(maxed), ...unref(classes) }" > - diff --git a/src/features/challenges/challenge.tsx b/src/features/challenges/challenge.tsx index 9ecf8a9..9ec22e3 100644 --- a/src/features/challenges/challenge.tsx +++ b/src/features/challenges/challenge.tsx @@ -73,7 +73,7 @@ export type Challenge = Replace< T & BaseChallenge, { visibility: GetComputableTypeWithDefault; - canStart: GetComputableTypeWithDefault>; + canStart: GetComputableTypeWithDefault; canComplete: GetComputableTypeWithDefault>; completionLimit: GetComputableTypeWithDefault; mark: GetComputableTypeWithDefault>; @@ -209,6 +209,7 @@ export function createChallenge( } processComputable(challenge as T, "canStart"); + setDefault(challenge, "canStart", true); processComputable(challenge as T, "canComplete"); processComputable(challenge as T, "completionLimit"); setDefault(challenge, "completionLimit", 1);