diff --git a/frontend/src/toolbar/bar/toolbarLogic.ts b/frontend/src/toolbar/bar/toolbarLogic.ts index d19ec13c6ff1c..04a498f3d9ecd 100644 --- a/frontend/src/toolbar/bar/toolbarLogic.ts +++ b/frontend/src/toolbar/bar/toolbarLogic.ts @@ -22,7 +22,7 @@ export const toolbarLogic = kea([ actionsTabLogic, ['showButtonActions', 'hideButtonActions'], elementsLogic, - ['enableInspect', 'disableInspect'], + ['enableInspect', 'disableInspect', 'createAction'], heatmapLogic, ['enableHeatmap', 'disableHeatmap'], ], @@ -254,6 +254,9 @@ export const toolbarLogic = kea([ setTimeout(() => sync(), 300) setTimeout(() => sync(), 550) }, + createAction: () => { + actions.setVisibleMenu('actions') + }, })), subscriptions({ theme: (theme) => { diff --git a/frontend/src/toolbar/elements/elementsLogic.ts b/frontend/src/toolbar/elements/elementsLogic.ts index d559b0831585e..d3d1b4f71dc74 100644 --- a/frontend/src/toolbar/elements/elementsLogic.ts +++ b/frontend/src/toolbar/elements/elementsLogic.ts @@ -1,6 +1,5 @@ import { kea, path, connect, actions, reducers, selectors, listeners, events } from 'kea' -import { toolbarLogic } from '~/toolbar/bar/toolbarLogic' import { actionsLogic } from '~/toolbar/actions/actionsLogic' import { heatmapLogic } from '~/toolbar/elements/heatmapLogic' import { elementToActionStep, getAllClickTargets, getElementForStep, getRectForElement } from '~/toolbar/utils' @@ -30,7 +29,7 @@ export const elementsLogic = kea([ path(['toolbar', 'elements', 'elementsLogic']), connect(() => ({ values: [actionsTabLogic, ['actionForm'], currentPageLogic, ['href']], - actions: [actionsTabLogic, ['selectAction']], + actions: [actionsTabLogic, ['selectAction', 'newAction']], })), actions({ enableInspect: true, @@ -402,9 +401,8 @@ export const elementsLogic = kea([ }) }, createAction: ({ element }) => { - toolbarLogic.actions.setVisibleMenu('actions') - elementsLogic.actions.selectElement(null) - actionsTabLogic.actions.newAction(element) + actions.selectElement(null) + actions.newAction(element) }, })), events(({ cache, values, actions }) => ({