Skip to content

Commit 55bc8af

Browse files
committed
fix: clear stale video effect state
1 parent 6b7124e commit 55bc8af

1 file changed

Lines changed: 18 additions & 23 deletions

File tree

examples/expo/app/examples/advanced/VideoEffect/VideoEffect.tsx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,11 @@ export default class VideoEffect
342342
return;
343343
}
344344
if (!this.applyOperations(this.buildBeautyOperations(beautyOptions))) {
345-
if (this.rollbackVideoEffectNode(VideoEffectNodeId.Beauty, 'Beauty')) {
346-
this.setState({
347-
appliedBeautyOptions: null,
348-
appliedBeautyTemplate: null,
349-
});
350-
}
345+
this.rollbackVideoEffectNode(VideoEffectNodeId.Beauty, 'Beauty');
346+
this.setState({
347+
appliedBeautyOptions: null,
348+
appliedBeautyTemplate: null,
349+
});
351350
return;
352351
}
353352
this.setState({
@@ -425,17 +424,14 @@ export default class VideoEffect
425424
buildStyleEffectOperations('style_makeup_option', styleIntensity)
426425
)
427426
) {
428-
if (
429-
this.rollbackVideoEffectNode(
430-
VideoEffectNodeId.StyleMakeup,
431-
'StyleMakeup'
432-
)
433-
) {
434-
this.setState({
435-
appliedStyleIntensity: null,
436-
appliedStyleMakeupTemplate: null,
437-
});
438-
}
427+
this.rollbackVideoEffectNode(
428+
VideoEffectNodeId.StyleMakeup,
429+
'StyleMakeup'
430+
);
431+
this.setState({
432+
appliedStyleIntensity: null,
433+
appliedStyleMakeupTemplate: null,
434+
});
439435
return;
440436
}
441437
this.setState({
@@ -478,12 +474,11 @@ export default class VideoEffect
478474
buildStyleEffectOperations('filter_effect_option', filterStrength)
479475
)
480476
) {
481-
if (this.rollbackVideoEffectNode(VideoEffectNodeId.Filter, 'Filter')) {
482-
this.setState({
483-
appliedFilterStrength: null,
484-
appliedFilterTemplate: null,
485-
});
486-
}
477+
this.rollbackVideoEffectNode(VideoEffectNodeId.Filter, 'Filter');
478+
this.setState({
479+
appliedFilterStrength: null,
480+
appliedFilterTemplate: null,
481+
});
487482
return;
488483
}
489484
this.setState({

0 commit comments

Comments
 (0)