@@ -6,6 +6,7 @@ import { EntryActions, EntryActionTypes } from './entry.actions';
66export interface EntryState {
77 active : Entry ;
88 isLoading : boolean ;
9+ isLoading2 : boolean ;
910 message : string ;
1011 createError : boolean ;
1112 updateError : boolean ;
@@ -20,6 +21,7 @@ const emptyTimeEntriesSummary: TimeEntriesSummary = { day: emptyTimeDetails, wee
2021export const initialState = {
2122 active : null ,
2223 isLoading : false ,
24+ isLoading2 : false ,
2325 message : '' ,
2426 createError : null ,
2527 updateError : null ,
@@ -56,19 +58,24 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
5658 return {
5759 ...state ,
5860 isLoading : true ,
61+ isLoading2 : true ,
5962 } ;
6063 }
6164 case EntryActionTypes . LOAD_ACTIVE_ENTRY_SUCCESS :
6265 return {
6366 ...state ,
6467 active : action . payload ,
6568 isLoading : false ,
69+ isLoading2 : false ,
6670 } ;
6771 case EntryActionTypes . LOAD_ACTIVE_ENTRY_FAIL : {
72+ console . log ( 'jjsjd' ) ;
73+
6874 return {
6975 ...state ,
7076 active : null ,
7177 isLoading : false ,
78+ isLoading2 : false ,
7279 message : 'Something went wrong fetching active entry!' ,
7380 } ;
7481 }
@@ -93,6 +100,8 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
93100 } ;
94101
95102 case EntryActionTypes . LOAD_ENTRIES_FAIL : {
103+ console . log ( 'here' ) ;
104+
96105 return {
97106 ...state ,
98107 message : 'Something went wrong fetching entries!' ,
@@ -210,6 +219,7 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
210219 return {
211220 ...state ,
212221 isLoading : true ,
222+ isLoading2 : true ,
213223 } ;
214224 }
215225
@@ -221,10 +231,27 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
221231 } ;
222232 }
223233
234+ case EntryActionTypes . UPDATE_ENTRY_RUNNING : {
235+ console . log ( 'UPDATE_ENTRY_RUNNING ' ) ;
236+
237+ return {
238+ ...state ,
239+ isLoading2 : true ,
240+ } ;
241+ }
242+
243+ case EntryActionTypes . SWITCH_TIME_ENTRY : {
244+ return {
245+ ...state ,
246+ isLoading2 : true ,
247+ } ;
248+ }
249+
224250 case EntryActionTypes . STOP_TIME_ENTRY_RUNNING : {
225251 return {
226252 ...state ,
227253 isLoading : true ,
254+ isLoading2 : true ,
228255 } ;
229256 }
230257
@@ -233,7 +260,15 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
233260 ...state ,
234261 active : null ,
235262 isLoading : false ,
236- message : 'You clocked-out successfully' ,
263+ isLoading2 : false ,
264+ message : 'You clocked-out successfullys' ,
265+ } ;
266+ }
267+
268+ case EntryActionTypes . CLOCK_IN : {
269+ return {
270+ ...state ,
271+ isLoading2 : true ,
237272 } ;
238273 }
239274
0 commit comments