Skip to content

Commit

Permalink
Merge pull request #88 from launchrctl/linter
Browse files Browse the repository at this point in the history
Linter fix
  • Loading branch information
iberdinsky-skilld authored Sep 12, 2024
2 parents b536345 + ad34ee5 commit cf079bd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
40 changes: 24 additions & 16 deletions client/src/components/GlobalKBarProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ export const GlobalKBarProvider: FC<Props> = ({ children }) => {
const dispatch = useActionDispatch()
const navigate = useNavigate()

if (!isError && !isLoading) {
const kbar: KBarProviderProps['actions'] = []
data?.data?.forEach((action) => {
kbar.push({
id: action.id,
name: `${action.title} (${action.id})`,
perform: () => {
navigate('/flow')
dispatch?.({
type: 'set-active-action',
id: action.id,
})
},
})
})
return <KBarProvider actions={kbar}>{children}</KBarProvider>
if (isError) {
return null
}

if (isLoading) {
return null
}

const kbar: KBarProviderProps['actions'] = []

data?.data?.forEach((action) => {
kbar.push({
id: action.id,
name: `${action.title} (${action.id})`,
perform: () => {
navigate('/flow')
dispatch?.({
type: 'set-active-action',
id: action.id,
})
},
})
})

return <KBarProvider actions={kbar}>{children}</KBarProvider>
}
8 changes: 6 additions & 2 deletions client/src/components/SidebarTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,15 @@ export const SidebarTree: FC<{
})()
setExpandedItems(expandItems.reverse())
if (selectedAction) {
const prevSelectedAction = apiRef.current?.getItem(selectedAction)
const prevSelectedAction = (
apiRef.current as { getItem: (id: string) => any }

Check warning on line 351 in client/src/components/SidebarTree.tsx

View workflow job for this annotation

GitHub Actions / build_and_archive

Unexpected any. Specify a different type
)?.getItem(selectedAction)
prevSelectedAction.selected = false
setSelectedAction('')
}
const curSelectedAction = apiRef.current?.getItem(nodeId)
const curSelectedAction = (
apiRef.current as { getItem: (id: string) => any }

Check warning on line 357 in client/src/components/SidebarTree.tsx

View workflow job for this annotation

GitHub Actions / build_and_archive

Unexpected any. Specify a different type
)?.getItem(nodeId)
if (curSelectedAction?.selected) {
curSelectedAction.selected = nodeId
}
Expand Down

0 comments on commit cf079bd

Please sign in to comment.