File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,18 @@ const ChainedResultsWrapper = () => {
135135 if ( ! election || election instanceof InvalidElection || loading || loaded ) return
136136 setLoading ( true )
137137 ; ( async ( ) => {
138- const { processes : fetchedProcesses , ids } = await getAllProcessesInFlow ( client , election )
139- for ( const process of fetchedProcesses ) {
140- setProcess ( process . id , process )
138+ try {
139+ const { processes : fetchedProcesses , ids } = await getAllProcessesInFlow ( client , election )
140+ for ( const process of fetchedProcesses ) {
141+ setProcess ( process . id , process )
142+ }
143+ setSorted ( ids )
144+ } catch ( e ) {
145+ console . error ( 'error fetching chained processes' , e )
146+ } finally {
147+ setLoaded ( true )
148+ setLoading ( false )
141149 }
142- setSorted ( ids )
143- setLoaded ( true )
144- setLoading ( false )
145150 } ) ( )
146151 } , [ election ] )
147152
@@ -244,7 +249,10 @@ export const getAllProcessesInFlow = async (
244249 }
245250
246251 const meta = election . get ( 'multiprocess' )
247- const initialIds = [ election . id , ...getProcessIdsInFlowStep ( meta ) ]
252+ const initialIds = [ election . id ]
253+ if ( meta ) {
254+ initialIds . push ( ...getProcessIdsInFlowStep ( meta ) )
255+ }
248256 for ( const id of initialIds ) {
249257 await loadProcess ( id )
250258 }
You can’t perform that action at this time.
0 commit comments