@@ -29,6 +29,7 @@ import {
29
29
removeFromZaakSelection ,
30
30
} from "../../../lib/zaakSelection/zaakSelection" ;
31
31
import { ExpandZaak , Zaak } from "../../../types" ;
32
+ import { FIELD_SELECTION_STORAGE_KEY } from "../../constants" ;
32
33
33
34
/** The template used to format urls to an external application providing zaak details. */
34
35
const REACT_APP_ZAAK_URL_TEMPLATE = process . env . REACT_APP_ZAAK_URL_TEMPLATE ;
@@ -90,7 +91,7 @@ export function useDataGridProps(
90
91
const [ fieldSelectionState , setFieldSelectionState ] =
91
92
useState < FieldSelection > ( ) ;
92
93
useEffect ( ( ) => {
93
- getFieldSelection ( storageKey ) . then ( ( fieldSelection ) =>
94
+ getFieldSelection ( FIELD_SELECTION_STORAGE_KEY ) . then ( ( fieldSelection ) =>
94
95
setFieldSelectionState ( fieldSelection ) ,
95
96
) ;
96
97
} , [ ] ) ;
@@ -191,9 +192,9 @@ export function useDataGridProps(
191
192
const onFieldsChange = async ( fields : TypedField [ ] ) => {
192
193
const activeFields = fields . filter ( ( f ) => f . active !== false ) ;
193
194
const inActiveFields = fields . filter ( ( f ) => f . active === false ) ;
194
- await addToFieldSelection ( storageKey , activeFields ) ;
195
- await removeFromFieldSelection ( storageKey , inActiveFields ) ;
196
- const fieldSelection = await getFieldSelection ( storageKey ) ;
195
+ await addToFieldSelection ( FIELD_SELECTION_STORAGE_KEY , activeFields ) ;
196
+ await removeFromFieldSelection ( FIELD_SELECTION_STORAGE_KEY , inActiveFields ) ;
197
+ const fieldSelection = await getFieldSelection ( FIELD_SELECTION_STORAGE_KEY ) ;
197
198
setFieldSelectionState ( fieldSelection ) ;
198
199
} ;
199
200
0 commit comments