@@ -5,17 +5,6 @@ import {
55} from "@knocklabs/client" ;
66import { useGuideContext , useStore } from "@knocklabs/react-core" ;
77
8- const resolveIsEligible = ( {
9- active,
10- targetable,
11- archived,
12- } : AnnotatedStatuses ) => {
13- if ( ! active . status ) return false ;
14- if ( ! targetable . status ) return false ;
15- if ( archived . status ) return false ;
16- return true ;
17- } ;
18-
198// Active: `true` status = good
209type ActiveStatus = {
2110 status : boolean ;
@@ -44,7 +33,7 @@ type AnnotatedStatuses = {
4433 archived : ArchivedStatus ;
4534} ;
4635
47- export type GuideAnnotation = AnnotatedStatuses & {
36+ type GuideAnnotation = AnnotatedStatuses & {
4837 // Resolved eligibility based on active, targetable and archived statuses,
4938 // which are backend driven evaluation results that are exposed for debugging.
5039 isEligible : boolean ;
@@ -99,6 +88,17 @@ const toArchivedStatus = (
9988 } ;
10089} ;
10190
91+ const resolveIsEligible = ( {
92+ active,
93+ targetable,
94+ archived,
95+ } : AnnotatedStatuses ) => {
96+ if ( ! active . status ) return false ;
97+ if ( ! targetable . status ) return false ;
98+ if ( archived . status ) return false ;
99+ return true ;
100+ } ;
101+
102102type StoreStateSnapshot = Pick <
103103 KnockGuideClientStoreState ,
104104 "guides" | "guideGroups" | "ineligibleGuides" | "debug"
0 commit comments