From 82420256a29795885fd529b085e98305fe566a19 Mon Sep 17 00:00:00 2001 From: wangqianliang Date: Tue, 26 Feb 2019 14:39:23 +0800 Subject: [PATCH] fix(code/frontend): should show import modal --- .../code/public/components/admin_page/project_tab.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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: '',