Skip to content

Commit a136341

Browse files
WangQianliangzfy0701
authored andcommitted
fix(code/frontend): should show import modal (#31987)
1 parent d81f066 commit a136341

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

x-pack/plugins/code/public/components/admin_page/project_tab.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,24 @@ interface Props {
7777
}
7878
interface State {
7979
showImportProjectModal: boolean;
80+
importLoading: boolean;
8081
settingModal: { url?: string; uri?: string; show: boolean };
8182
repoURL: string;
8283
sortOption: SortOptionsValue;
8384
}
8485

8586
class CodeProjectTab extends React.PureComponent<Props, State> {
8687
public static getDerivedStateFromProps(props: Props, state: State) {
87-
if (state.showImportProjectModal && !props.importLoading) {
88-
return { showImportProjectModal: false };
88+
if (state.importLoading && !props.importLoading) {
89+
return { showImportProjectModal: false, importLoading: props.importLoading };
8990
}
90-
return null;
91+
return { importLoading: props.importLoading };
9192
}
9293

9394
constructor(props: Props) {
9495
super(props);
9596
this.state = {
97+
importLoading: false,
9698
showImportProjectModal: false,
9799
settingModal: { show: false },
98100
repoURL: '',

0 commit comments

Comments
 (0)