Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7e748b

Browse files
committed
fix: action limitor
1 parent 3cdc31f commit e7e748b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

client/packages/openblocks/src/comps/controls/actionSelector/actionSelectorControl.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,22 @@ function actionSelectorControl(needContext: boolean) {
279279
if (!this.children.condition.getView()) {
280280
return;
281281
}
282+
283+
let executor = (x: Function) => x();
284+
285+
const limitEnabled = !!this.children.delay.unevaledValue;
286+
if (limitEnabled) {
287+
executor = limitExecutor(
288+
this,
289+
"execute_query",
290+
this.children.slowdown.getView(),
291+
this.children.delay.getView()
292+
);
293+
}
294+
282295
return () =>
283296
getPromiseAfterExecuteDispatch(
284-
limitExecutor(
285-
this,
286-
"execute_query",
287-
this.children.slowdown.getView(),
288-
this.children.delay.getView()
289-
),
297+
executor,
290298
this.dispatch,
291299
customAction<ActionTriggered>({
292300
type: ACTION_TRIGGERED_TYPE_STRING,

0 commit comments

Comments
 (0)