File tree Expand file tree Collapse file tree
frontend/packages/core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ const RunList: FunctionComponent<{count?: number}> = ({count}) => {
2222 return (
2323 < ContentLoader viewBox = { `0 0 220 ${ ( count ?? 2 ) * 36 } ` } >
2424 { Array . from ( { length : count ?? 2 } ) . map ( ( _ , i ) => (
25- < >
25+ < React . Fragment key = { i } >
2626 < rect x = "0" y = { `${ 11 * ( i + 1 ) + 25 * i + 4.5 } ` } width = "16" height = "16" />
2727 < circle cx = "32" cy = { `${ 11 * ( i + 1 ) + 25 * i + 12.5 } ` } r = "6" />
2828 < rect x = "46" y = { `${ 11 * ( i + 1 ) + 25 * i + 5.5 } ` } rx = "3" ry = "3" width = "100" height = "14" />
29- </ >
29+ </ React . Fragment >
3030 ) ) }
3131 </ ContentLoader >
3232 ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ const Graph: FunctionComponent = () => {
9494 const graph = useRef < GraphRef > ( null ) ;
9595 const file = useRef < HTMLInputElement > ( null ) ;
9696 const [ files , setFiles ] = useState < FileList | File [ ] | null > ( storeModel ) ;
97+ const setModelFile = useCallback (
98+ ( f : FileList | File [ ] ) => {
99+ storeDispatch ( actions . graph . setModel ( f ) ) ;
100+ setFiles ( f ) ;
101+ } ,
102+ [ storeDispatch ]
103+ ) ;
97104 const onClickFile = useCallback ( ( ) => {
98105 if ( file . current ) {
99106 file . current . value = '' ;
@@ -104,11 +111,10 @@ const Graph: FunctionComponent = () => {
104111 ( e : React . ChangeEvent < HTMLInputElement > ) => {
105112 const target = e . target ;
106113 if ( target && target . files && target . files . length ) {
107- storeDispatch ( actions . graph . setModel ( target . files ) ) ;
108- setFiles ( target . files ) ;
114+ setModelFile ( target . files ) ;
109115 }
110116 } ,
111- [ storeDispatch ]
117+ [ setModelFile ]
112118 ) ;
113119
114120 const { data, loading} = useRequest < BlobResponse > ( files ? null : '/graph/graph' ) ;
@@ -280,7 +286,10 @@ const Graph: FunctionComponent = () => {
280286 nodeDocumentation
281287 ] ) ;
282288
283- const uploader = useMemo ( ( ) => < Uploader onClickUpload = { onClickFile } onDropFiles = { setFiles } /> , [ onClickFile ] ) ;
289+ const uploader = useMemo ( ( ) => < Uploader onClickUpload = { onClickFile } onDropFiles = { setModelFile } /> , [
290+ onClickFile ,
291+ setModelFile
292+ ] ) ;
284293
285294 return (
286295 < >
You can’t perform that action at this time.
0 commit comments