@@ -104,6 +104,7 @@ export type TableState = {
104104 rows : EntityState < Row , string > ,
105105 maxLabel : string ,
106106 pagination : Pagination ,
107+ flags ?: { [ key in Resource ] ?: { isNewEventAdded ?: boolean } } ;
107108}
108109
109110const rowsAdapter = createEntityAdapter < Row > ( ) ;
@@ -179,6 +180,7 @@ const initialState: TableState = {
179180 totalItems : 0 ,
180181 directAccessibleNo : 3 ,
181182 } ,
183+ flags : { } ,
182184} ;
183185
184186const tableSlice = createSlice ( {
@@ -194,6 +196,7 @@ const tableSlice = createSlice({
194196 sortBy : TableState [ "sortBy" ] [ Resource ] ,
195197 reverse : TableState [ "reverse" ] [ Resource ] ,
196198 totalItems : TableState [ "pagination" ] [ "totalItems" ] ,
199+ flags ?: { isNewEventAdded ?: boolean } ,
197200 } > ) {
198201 state . multiSelect [ action . payload . resource ] = action . payload . multiSelect ;
199202 state . columns = action . payload . columns ;
@@ -205,6 +208,18 @@ const tableSlice = createSlice({
205208 ...state . pagination ,
206209 totalItems : action . payload . totalItems ,
207210 } ;
211+ if ( action . payload . flags ) {
212+ // Ensure state.flags exists
213+ state . flags ??= { } ;
214+ const resource = action . payload . resource ;
215+ // Ensure flags object for this resource exists
216+ state . flags [ resource ] ??= { } ;
217+ // Merge the new flags
218+ state . flags [ resource ] = {
219+ ...state . flags [ resource ] ,
220+ ...action . payload . flags ,
221+ } ;
222+ }
208223
209224 // Entity Adapter preparations
210225 const rows : Row [ ] = [ ] ;
0 commit comments