@@ -108,16 +108,16 @@ export const appStateReducer = (state: AppState, action: Action): AppState => {
108108 case 'SET_IS_REQUEST_INITIATED' :
109109 return { ...state , isRequestInitiated : action . payload }
110110 case 'ADD_FAILED_SECTION' :
111- var tempFailedSections = [ ...state . failedSections ] ;
112- const exists = tempFailedSections . some ( ( item ) => item . title === action . payload . title ) ;
113- if ( ! exists ) {
111+ const tempFailedSections = [ ...state . failedSections ] ;
112+ const exists = tempFailedSections . some ( ( item ) => item . title === action . payload . title ) ;
113+ if ( ! exists ) {
114114 tempFailedSections . push ( action . payload ) ;
115- }
116- return { ...state , failedSections : [ ...tempFailedSections ] }
117- case 'REMOVED_FAILED_SECTION' :
118- var tempFailedSections = state . failedSections . filter ( ( item ) => item . title !== action . payload . section . title ) ;
119- return { ...state , failedSections : [ ... tempFailedSections ] }
120- case 'UPDATE_SECTION_API_REQ_STATUS' :
115+ }
116+ return { ...state , failedSections : [ ...tempFailedSections ] }
117+ case 'REMOVED_FAILED_SECTION' :
118+ const filteredFailedSections = state . failedSections . filter ( ( item ) => item . title !== action . payload . section . title ) ;
119+ return { ...state , failedSections : filteredFailedSections }
120+ case 'UPDATE_SECTION_API_REQ_STATUS' :
121121 return { ...state , isFailedReqInitiated : action . payload }
122122
123123 case 'UPDATE_IS_LOADED_SECTIONS' :
0 commit comments