Skip to content

Commit

Permalink
fix(code/frontend): should show import modal (#31987)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangQianliang authored and zfy0701 committed Feb 26, 2019
1 parent d81f066 commit a136341
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,24 @@ interface Props {
}
interface State {
showImportProjectModal: boolean;
importLoading: boolean;
settingModal: { url?: string; uri?: string; show: boolean };
repoURL: string;
sortOption: SortOptionsValue;
}

class CodeProjectTab extends React.PureComponent<Props, State> {
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: '',
Expand Down

0 comments on commit a136341

Please sign in to comment.