Skip to content

Commit

Permalink
Fix up reference
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Nov 22, 2023
1 parent 7408ce5 commit 490da28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion frontend/src/toolbar/bar/toolbarLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const toolbarLogic = kea<toolbarLogicType>([
actionsTabLogic,
['showButtonActions', 'hideButtonActions'],
elementsLogic,
['enableInspect', 'disableInspect'],
['enableInspect', 'disableInspect', 'createAction'],
heatmapLogic,
['enableHeatmap', 'disableHeatmap'],
],
Expand Down Expand Up @@ -254,6 +254,9 @@ export const toolbarLogic = kea<toolbarLogicType>([
setTimeout(() => sync(), 300)
setTimeout(() => sync(), 550)
},
createAction: () => {
actions.setVisibleMenu('actions')
},
})),
subscriptions({
theme: (theme) => {
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/toolbar/elements/elementsLogic.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -30,7 +29,7 @@ export const elementsLogic = kea<elementsLogicType>([
path(['toolbar', 'elements', 'elementsLogic']),
connect(() => ({
values: [actionsTabLogic, ['actionForm'], currentPageLogic, ['href']],
actions: [actionsTabLogic, ['selectAction']],
actions: [actionsTabLogic, ['selectAction', 'newAction']],
})),
actions({
enableInspect: true,
Expand Down Expand Up @@ -402,9 +401,8 @@ export const elementsLogic = kea<elementsLogicType>([
})
},
createAction: ({ element }) => {
toolbarLogic.actions.setVisibleMenu('actions')
elementsLogic.actions.selectElement(null)
actionsTabLogic.actions.newAction(element)
actions.selectElement(null)
actions.newAction(element)
},
})),
events(({ cache, values, actions }) => ({
Expand Down

0 comments on commit 490da28

Please sign in to comment.