File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ export const FieldsProvider: FC<Prop> = ({children, scope}) => {
5050 const { query : queryAPI } = useContext ( QueryContext )
5151
5252 // States
53- const [ fields , setFields ] = useState < Array < string > > ( INITIAL_FIELDS )
53+ const [ fields , setFields ] = useState < Array < string > > (
54+ JSON . parse ( JSON . stringify ( INITIAL_FIELDS ) )
55+ )
5456 const [ loading , setLoading ] = useState < RemoteDataState > (
5557 RemoteDataState . NotStarted
5658 )
@@ -121,7 +123,7 @@ export const FieldsProvider: FC<Prop> = ({children, scope}) => {
121123 }
122124
123125 const resetFields = ( ) => {
124- setFields ( INITIAL_FIELDS )
126+ setFields ( JSON . parse ( JSON . stringify ( INITIAL_FIELDS ) ) )
125127 setLoading ( RemoteDataState . NotStarted )
126128 }
127129
Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ export const TagsProvider: FC<Prop> = ({children, scope}) => {
6161 const { query : queryAPI } = useContext ( QueryContext )
6262
6363 // States
64- const [ tags , setTags ] = useState < Tags > ( INITIAL_TAGS )
64+ const [ tags , setTags ] = useState < Tags > (
65+ JSON . parse ( JSON . stringify ( INITIAL_TAGS ) )
66+ )
6567 const [ loadingTagKeys , setLoadingTagKeys ] = useState < RemoteDataState > (
6668 RemoteDataState . NotStarted
6769 )
@@ -222,7 +224,7 @@ export const TagsProvider: FC<Prop> = ({children, scope}) => {
222224 }
223225
224226 const resetTags = ( ) => {
225- setTags ( INITIAL_TAGS )
227+ setTags ( JSON . parse ( JSON . stringify ( INITIAL_TAGS ) ) )
226228 setLoadingTagKeys ( RemoteDataState . NotStarted )
227229 setLoadingTagValues ( INITIAL_LOADING_TAG_VALUES )
228230 }
You can’t perform that action at this time.
0 commit comments