@@ -6,16 +6,21 @@ import { getAllFlowTests } from 'stores/utils';
66import useCollectionStore from 'stores/CollectionStore' ;
77
88const ComplexNode = ( { id, data } ) => {
9+ const { ipcRenderer } = window ;
10+
911 const setFlowForComplexNode = useCanvasStore ( ( state ) => state . setFlowForComplexNode ) ;
10- const collectionId = useCanvasStore ( ( state ) => state . collectionId ) ;
11- const flowTests = getAllFlowTests ( useCollectionStore . getState ( ) . collections . find ( ( c ) => c . id === collectionId ) ) ;
12+ const collectionId = useCanvasStore . getState ( ) . collectionId ;
13+ const collection = useCollectionStore . getState ( ) . collections . find ( ( c ) => c . id === collectionId ) ;
14+ const flowTests = getAllFlowTests ( collection ) . map ( ( fullPath ) => {
15+ return ipcRenderer . relative ( collection . pathname , fullPath ) ;
16+ } ) ;
1217
13- const setFlow = ( pathname ) => {
14- setFlowForComplexNode ( id , pathname ) ;
18+ const setFlow = ( relativePath ) => {
19+ setFlowForComplexNode ( id , relativePath ) ;
1520 } ;
1621
17- if ( data . pathname ) {
18- if ( ! flowTests . find ( ( f ) => f === data . pathname ) ) {
22+ if ( data . relativePath ) {
23+ if ( ! flowTests . find ( ( f ) => f === data . relativePath ) ) {
1924 setFlow ( '' ) ;
2025 }
2126 }
@@ -32,7 +37,7 @@ const ComplexNode = ({ id, data }) => {
3237 < select
3338 onChange = { ( e ) => setFlow ( e . target . value ) }
3439 name = 'flow'
35- value = { data . pathname ? data . pathname : '' }
40+ value = { data . relativePath ? data . relativePath : '' }
3641 className = 'h-12 outline-none max-w-32'
3742 >
3843 < option key = 'None' value = '' >
0 commit comments