fix(editor): Console error in ActionsMode when searching for action and pressing enter (no-changelog) (#9292)

This commit is contained in:
Mohammad Alsmadi 2024-06-20 15:54:46 +03:00 committed by GitHub
parent fdde9957c8
commit c334ecb2ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -146,11 +146,10 @@ function onSelected(actionCreateElement: INodeCreateElement) {
);
if (isPlaceholderTriggerAction && isTriggerRootView.value) {
const actionNode = actions.value[0].key;
emit('nodeTypeSelected', [actionData.key as string, actionNode]);
const actionNode = actions.value[0]?.key;
if (actionNode) emit('nodeTypeSelected', [actionData.key as string, actionNode]);
} else if (
actionData.key === OPEN_AI_NODE_TYPE &&
actionData?.key === OPEN_AI_NODE_TYPE &&
(actionData?.value as IDataObject)?.resource === 'assistant' &&
(actionData?.value as IDataObject)?.operation === 'message'
) {
@ -200,7 +199,8 @@ function addHttpNode() {
emit('nodeTypeSelected', [HTTP_REQUEST_NODE_TYPE]);
if (telemetry) setAddedNodeActionParameters(updateData);
const app_identifier = actions.value[0].key;
const app_identifier = actions.value[0]?.key;
if (!app_identifier) return;
void useExternalHooks().run('nodeCreateList.onActionsCustmAPIClicked', {
app_identifier,
});