@@ -93,6 +93,14 @@ export const QuickStartContextProvider: React.FC<{
9393 ...QuickStartContextDefaults ,
9494 ...value
9595 }
96+ const {
97+ activeQuickStartID,
98+ setActiveQuickStartID,
99+ setAllQuickStartStates,
100+ useQueryParams,
101+ allQuickStartStates,
102+ allQuickStarts
103+ } = combinedValue ;
96104 const [ quickStarts , setQuickStarts ] = React . useState ( combinedValue . allQuickStarts ) ;
97105 const [ resourceBundle , setResourceBundle ] = React . useState ( {
98106 ...en ,
@@ -116,7 +124,7 @@ export const QuickStartContextProvider: React.FC<{
116124 const initialSearchQuery = initialSearchParams . get ( QUICKSTART_SEARCH_FILTER_KEY ) || '' ;
117125 const initialStatusFilters = initialSearchParams . get ( QUICKSTART_STATUS_FILTER_KEY ) ?. split ( ',' ) || [ ] ;
118126
119- const quickStartStatusCount = getQuickStartStatusCount ( combinedValue . allQuickStartStates , combinedValue . allQuickStarts ) ;
127+ const quickStartStatusCount = getQuickStartStatusCount ( allQuickStartStates , allQuickStarts ) ;
120128 const [ statusTypes , setStatusTypes ] = React . useState ( {
121129 [ QuickStartStatus . COMPLETE ] : findResource ( 'Complete ({{statusCount, number}})' ) . replace ( '{{statusCount, number}}' , quickStartStatusCount [ QuickStartStatus . COMPLETE ] ) ,
122130 [ QuickStartStatus . IN_PROGRESS ] : findResource ( 'In progress ({{statusCount, number}})' ) . replace ( '{{statusCount, number}}' , quickStartStatusCount [ QuickStartStatus . IN_PROGRESS ] ) ,
@@ -134,17 +142,18 @@ export const QuickStartContextProvider: React.FC<{
134142 }
135143 } ;
136144
137- const updateAllQuickStarts = ( quickStarts : QuickStart [ ] ) => {
138- setQuickStarts ( quickStarts ) ;
139- const updatedQuickStartStatusCount = getQuickStartStatusCount ( combinedValue . allQuickStartStates , quickStarts ) ;
145+ React . useEffect ( ( ) => {
146+ const updatedQuickStartStatusCount = getQuickStartStatusCount ( allQuickStartStates , quickStarts ) ;
140147 setStatusTypes ( {
141148 [ QuickStartStatus . COMPLETE ] : findResource ( 'Complete ({{statusCount, number}})' ) . replace ( '{{statusCount, number}}' , updatedQuickStartStatusCount [ QuickStartStatus . COMPLETE ] ) ,
142149 [ QuickStartStatus . IN_PROGRESS ] : findResource ( 'In progress ({{statusCount, number}})' ) . replace ( '{{statusCount, number}}' , updatedQuickStartStatusCount [ QuickStartStatus . IN_PROGRESS ] ) ,
143150 [ QuickStartStatus . NOT_STARTED ] : findResource ( 'Not started ({{statusCount, number}})' ) . replace ( '{{statusCount, number}}' , updatedQuickStartStatusCount [ QuickStartStatus . NOT_STARTED ] ) ,
144151 } ) ;
145- } ;
152+ } , [ allQuickStartStates , quickStarts ] )
146153
147- const { activeQuickStartID, setActiveQuickStartID, setAllQuickStartStates, useQueryParams, allQuickStartStates } = combinedValue ;
154+ const updateAllQuickStarts = ( quickStarts : QuickStart [ ] ) => {
155+ setQuickStarts ( quickStarts ) ;
156+ } ;
148157
149158 const setActiveQuickStart = useCallback (
150159 ( quickStartId : string , totalTasks ?: number ) => {
0 commit comments