File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/app/create/[id]/createBlueprintSteps Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -144,12 +144,18 @@ const ExtractFields = ({
144144 parsedRegex ,
145145 revealPrivateFields
146146 ) ;
147+
147148 setRegexGeneratedOutputs ( ( prev ) => {
148149 const updated = [ ...prev ] ;
149150 // @ts -ignore
150151 updated [ index ] = regexOutputs ;
151152 return updated ;
152153 } ) ;
154+
155+ // update the max length of the regex at that particular index
156+ const decomposedRegexes = [ ...store . decomposedRegexes ] ;
157+ decomposedRegexes [ index ] . maxLength = regexOutputs [ 0 ] . length ?? 64 ;
158+ setField ( 'decomposedRegexes' , decomposedRegexes ) ;
153159 } catch ( error ) {
154160 console . error ( 'Error testing decomposed regex:' , error ) ;
155161 setRegexGeneratedOutputs ( ( prev ) => {
@@ -168,7 +174,18 @@ const ExtractFields = ({
168174 generateRegexOutputs ( ) . finally ( ( ) => {
169175 setIsGeneratingFields ( false ) ;
170176 } ) ;
171- } , [ file , JSON . stringify ( store . decomposedRegexes ) ] ) ;
177+ } , [
178+ file ,
179+ revealPrivateFields ,
180+ JSON . stringify (
181+ store . decomposedRegexes ?. map ( ( regex ) => ( {
182+ name : regex . name ,
183+ location : regex . location ,
184+ parts : regex . parts ,
185+ isHashed : regex . isHashed ,
186+ } ) )
187+ ) ,
188+ ] ) ;
172189
173190 const handleGenerateFields = async ( index : number ) => {
174191 const updatedIsGeneratingFieldsLoading = [ ...isGeneratingFieldsLoading ] ;
You can’t perform that action at this time.
0 commit comments