Skip to content

Commit 2da6393

Browse files
author
xwj02155382
committed
fix: grafhSelect bug
1 parent cde732c commit 2da6393

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

packages/studio-website/src/pages/modeling/save-modeling.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Utils } from '@graphscope/studio-components';
99
import { useHistory } from '../../hooks';
1010
import localforage from 'localforage';
1111
import { FormattedMessage } from 'react-intl';
12+
import { listGraphs } from '../instance/lists/service';
1213

1314
interface 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

0 commit comments

Comments
 (0)