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 = ({
144
144
parsedRegex ,
145
145
revealPrivateFields
146
146
) ;
147
+
147
148
setRegexGeneratedOutputs ( ( prev ) => {
148
149
const updated = [ ...prev ] ;
149
150
// @ts -ignore
150
151
updated [ index ] = regexOutputs ;
151
152
return updated ;
152
153
} ) ;
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 ) ;
153
159
} catch ( error ) {
154
160
console . error ( 'Error testing decomposed regex:' , error ) ;
155
161
setRegexGeneratedOutputs ( ( prev ) => {
@@ -168,7 +174,18 @@ const ExtractFields = ({
168
174
generateRegexOutputs ( ) . finally ( ( ) => {
169
175
setIsGeneratingFields ( false ) ;
170
176
} ) ;
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
+ ] ) ;
172
189
173
190
const handleGenerateFields = async ( index : number ) => {
174
191
const updatedIsGeneratingFieldsLoading = [ ...isGeneratingFieldsLoading ] ;
You can’t perform that action at this time.
0 commit comments