Skip to content

Commit

Permalink
fix: Loop requests in toolbar (#21061)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Mar 21, 2024
1 parent da97985 commit cca6ccb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions frontend/src/toolbar/actions/ActionsListView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Link } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { Spinner } from 'lib/lemon-ui/Spinner'
import { useEffect } from 'react'

import { actionsLogic } from '~/toolbar/actions/actionsLogic'
import { actionsTabLogic } from '~/toolbar/actions/actionsTabLogic'
Expand All @@ -13,13 +12,8 @@ interface ActionsListViewProps {

export function ActionsListView({ actions }: ActionsListViewProps): JSX.Element {
const { allActionsLoading, searchTerm } = useValues(actionsLogic)
const { getActions } = useActions(actionsLogic)
const { selectAction } = useActions(actionsTabLogic)

useEffect(() => {
getActions()
}, [])

return (
<div className="flex flex-col h-full overflow-y-scoll space-y-px">
{actions.length ? (
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/toolbar/actions/ActionsToolbarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonInput } from 'lib/lemon-ui/LemonInput'
import { Link } from 'lib/lemon-ui/Link'
import { Spinner } from 'lib/lemon-ui/Spinner'
import { useEffect } from 'react'
import { urls } from 'scenes/urls'

import { ActionsEditingToolbarMenu } from '~/toolbar/actions/ActionsEditingToolbarMenu'
Expand All @@ -16,13 +17,17 @@ import { toolbarConfigLogic } from '~/toolbar/toolbarConfigLogic'

const ActionsListToolbarMenu = (): JSX.Element => {
const { searchTerm } = useValues(actionsLogic)
const { setSearchTerm } = useActions(actionsLogic)
const { setSearchTerm, getActions } = useActions(actionsLogic)

const { newAction } = useActions(actionsTabLogic)
const { allActions, sortedActions, allActionsLoading } = useValues(actionsLogic)

const { apiURL } = useValues(toolbarConfigLogic)

useEffect(() => {
getActions()
}, [])

return (
<ToolbarMenu>
<ToolbarMenu.Header>
Expand Down

0 comments on commit cca6ccb

Please sign in to comment.