File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
packages/studio-website/src/pages/modeling Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { Utils } from '@graphscope/studio-components';
99import { useHistory } from '../../hooks' ;
1010import localforage from 'localforage' ;
1111import { FormattedMessage } from 'react-intl' ;
12+ import { listGraphs } from '../instance/lists/service' ;
1213
1314interface SaveModelingProps {
1415 id : string ;
@@ -80,17 +81,26 @@ const SaveModeling: React.FunctionComponent<SaveModelingProps> = props => {
8081 Utils . setSearchParams ( { graph_id : graph_id } ) ;
8182 /** 设置Schema */
8283 await localforage . setItem ( `GRAPH_SCHEMA_OPTIONS_${ graph_id } ` , Utils . fakeSnapshot ( schema ) ) ;
83- //@ts -ignore
84- setState ( preState => {
85- return {
86- ...preState ,
87- status : _status ,
88- message : _message ,
89- schema : schema ,
90- open : true ,
91- id : graph_id ,
92- } ;
93- } ) ;
84+ try {
85+ const graphsRes = await listGraphs ( ) ;
86+ updateStore ( draft => {
87+ draft . graphs = graphsRes || [ ] ;
88+ } ) ;
89+ } catch ( error ) {
90+ console . error ( error ) ;
91+ } finally {
92+ //@ts -ignore
93+ setState ( preState => {
94+ return {
95+ ...preState ,
96+ status : _status ,
97+ message : _message ,
98+ schema : schema ,
99+ open : true ,
100+ id : graph_id ,
101+ } ;
102+ } ) ;
103+ }
94104 }
95105 } ;
96106
You can’t perform that action at this time.
0 commit comments