File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
frontend/src/components/visual-editor/hooks Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -349,13 +349,19 @@ const VisualEditorProvider: React.FC<VisualEditorContextProps> = ({
349
349
}
350
350
}
351
351
352
- async function handleHighlightFlow ( payload : any ) {
352
+ async function handleHighlightFlow ( payload : {
353
+ flowId : string ;
354
+ blockId : string ;
355
+ userId : string ;
356
+ } ) {
353
357
await removeHighlights ( ) ;
354
358
355
359
await redirectToTriggeredFlow ( selectedCategoryId , payload . flowId ) ;
356
360
357
361
setTimeout ( ( ) => {
358
- const block = engine ?. getModel ( ) . getNode ( payload . blockId ) as NodeModel ;
362
+ const block = engine ?. getModel ( ) . getNode ( payload . blockId ) as
363
+ | NodeModel
364
+ | undefined ;
359
365
360
366
if ( ! block ) {
361
367
return ;
@@ -372,12 +378,18 @@ const VisualEditorProvider: React.FC<VisualEditorContextProps> = ({
372
378
} , 200 ) ;
373
379
}
374
380
375
- async function handleHighlightErroredBlock ( payload : any ) {
381
+ async function handleHighlightErroredBlock ( payload : {
382
+ flowId : string ;
383
+ blockId : string ;
384
+ userId : string ;
385
+ } ) {
376
386
await removeHighlights ( ) ;
377
387
378
388
await redirectToTriggeredFlow ( selectedCategoryId , payload . flowId ) ;
379
389
setTimeout ( ( ) => {
380
- const block = engine ?. getModel ( ) . getNode ( payload . blockId ) as NodeModel ;
390
+ const block = engine ?. getModel ( ) . getNode ( payload . blockId ) as
391
+ | NodeModel
392
+ | undefined ;
381
393
382
394
if ( ! block ) {
383
395
return ;
@@ -390,7 +402,7 @@ const VisualEditorProvider: React.FC<VisualEditorContextProps> = ({
390
402
block . setHasErrored ( true ) ;
391
403
392
404
engine . repaintCanvas ( ) ;
393
- } , 220 ) ;
405
+ } , 200 ) ;
394
406
}
395
407
useSubscribe ( "highlight:block" , handleHighlightFlow ) ;
396
408
You can’t perform that action at this time.
0 commit comments