From d121aefbaa86b18ccaca1fc9acbd4e65b158b109 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 5 Apr 2022 14:00:44 +0100 Subject: [PATCH] Reset buttion action output context on each invocation of the action --- packages/client/src/utils/buttonActions.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 874ea3bcb6..f851a623c0 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -329,13 +329,13 @@ export const enrichButtonActions = (actions, context) => { return actions } - // Button context is built up as actions are executed. - // Inherit any previous button context which may have come from actions - // before a confirmable action since this breaks the chain. - let buttonContext = context.actions || [] - const handlers = actions.map(def => handlerMap[def["##eventHandlerType"]]) return async eventContext => { + // Button context is built up as actions are executed. + // Inherit any previous button context which may have come from actions + // before a confirmable action since this breaks the chain. + let buttonContext = context.actions || [] + for (let i = 0; i < handlers.length; i++) { try { // Skip any non-existent action definitions