midah commited on
Commit
db2aa23
·
1 Parent(s): 39cb8cd

fix: TypeScript build error - explicitly type EdgeType array in useState

Browse files

The build was failing because TypeScript inferred the Set as Set<string> instead of Set<EdgeType>. Adding explicit type assertion fixes the HF Spaces build.

Files changed (1) hide show
  1. frontend/src/App.tsx +1 -1
frontend/src/App.tsx CHANGED
@@ -99,7 +99,7 @@ function App() {
99
  const [graphError, setGraphError] = useState<string | null>(null);
100
  const [graphStats, setGraphStats] = useState<{ nodes: number; edges: number } | null>(null);
101
  const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
102
- const [enabledEdgeTypes, setEnabledEdgeTypes] = useState<Set<EdgeType>>(new Set(['finetune', 'quantized', 'adapter', 'merge', 'parent']));
103
 
104
  // Threshold for using instanced rendering
105
  const INSTANCED_THRESHOLD = 10000;
 
99
  const [graphError, setGraphError] = useState<string | null>(null);
100
  const [graphStats, setGraphStats] = useState<{ nodes: number; edges: number } | null>(null);
101
  const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
102
+ const [enabledEdgeTypes, setEnabledEdgeTypes] = useState<Set<EdgeType>>(new Set(['finetune', 'quantized', 'adapter', 'merge', 'parent'] as EdgeType[]));
103
 
104
  // Threshold for using instanced rendering
105
  const INSTANCED_THRESHOLD = 10000;