Skip to content

Commit

Permalink
feat: #comment resolved issues with local type compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
scrthq committed Oct 1, 2024
1 parent 0cb0eea commit d0ac9ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/App.tsx

import React, { useState, useCallback, useEffect, useMemo } from 'react'
import { useState, useCallback, useEffect, useMemo } from 'react'
import {
ReactFlow,
MiniMap,
Expand All @@ -9,8 +9,9 @@ import {
useNodesState,
useEdgesState,
addEdge,
Connection,
Node,
Edge,
Connection,
} from '@xyflow/react'
import '@xyflow/react/dist/style.css'
import './reactflow-dark.css'
Expand All @@ -36,14 +37,14 @@ function AudioDeviceArrangerApp() {
devices,
isLoading,
addDevice,
updateDevicePosition,
// updateDevicePosition,
updateDevice,
deleteDevice,
addConnection,
} = useAudioDeviceStore()

const [nodes, setNodes, onNodesChange] = useNodesState([])
const [edges, setEdges, onEdgesChange] = useEdgesState([])
const [nodes, setNodes, onNodesChange] = useNodesState<Node>([])
const [edges, setEdges, onEdgesChange] = useEdgesState<Edge>([])

const [isDarkMode, setIsDarkMode] = useState(() => {
const saved = localStorage.getItem('darkMode')
Expand Down Expand Up @@ -75,7 +76,7 @@ function AudioDeviceArrangerApp() {
}))
setNodes(flowNodes)
}
}, [devices, setNodes])
}, [devices])

const defaultEdgeOptions = useMemo(
() => ({
Expand All @@ -98,10 +99,10 @@ function AudioDeviceArrangerApp() {
},
})),
)
}, [isDarkMode, setEdges])
}, [isDarkMode])

const onConnect = useCallback(
(params: Edge | Connection) => {
(params: Connection) => {
const newEdge = {
...params,
animated: true,
Expand All @@ -110,9 +111,9 @@ function AudioDeviceArrangerApp() {
setEdges(eds => addEdge(newEdge, eds))
addConnection({
id: `${params.source}-${params.target}`,
sourceDeviceId: params.source as string,
sourceDeviceId: params.source,
sourcePortId: params.sourceHandle as string,
targetDeviceId: params.target as string,
targetDeviceId: params.target,
targetPortId: params.targetHandle as string,
})
},
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAudioDeviceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function useAudioDeviceStore() {
)
return { previousDevices }
},
onError: (err, newTodo, context) => {
onError: (_err, _newTodo, context) => {
queryClient.setQueryData(DEVICES_KEY, context?.previousDevices)
},
onSettled: () => {
Expand Down

0 comments on commit d0ac9ec

Please sign in to comment.