diff --git a/x-pack/plugins/code/public/components/admin_page/project_tab.tsx b/x-pack/plugins/code/public/components/admin_page/project_tab.tsx index 910ea4305bd3c..50adac0deead4 100644 --- a/x-pack/plugins/code/public/components/admin_page/project_tab.tsx +++ b/x-pack/plugins/code/public/components/admin_page/project_tab.tsx @@ -72,6 +72,7 @@ interface Props { } interface State { showImportProjectModal: boolean; + importLoading: boolean; settingModal: { url?: string; uri?: string; show: boolean }; repoURL: string; sortOption: SortOptionsValue; @@ -79,15 +80,16 @@ interface State { class CodeProjectTab extends React.PureComponent { public static getDerivedStateFromProps(props: Props, state: State) { - if (state.showImportProjectModal && !props.importLoading) { - return { showImportProjectModal: false }; + if (state.importLoading && !props.importLoading) { + return { showImportProjectModal: false, importLoading: props.importLoading }; } - return null; + return { importLoading: props.importLoading }; } constructor(props: Props) { super(props); this.state = { + importLoading: false, showImportProjectModal: false, settingModal: { show: false }, repoURL: '',