Skip to content

Commit

Permalink
feat: show only ready models in the list (microsoft#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-krasn authored Jul 29, 2020
1 parent 84f8285 commit 0e1b637
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/react/components/pages/modelCompose/modelCompose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ export default class ModelComposePage extends React.Component<IModelComposePageP
return item.key;
}

private returnReadyModels = (modelList) => modelList.filter((model: IModel) => model.status === constants.statusCodeReady);

private getModelList = async () => {
try {
this.setState({
Expand All @@ -361,7 +363,7 @@ export default class ModelComposePage extends React.Component<IModelComposePageP
}

const res = await this.getResponse();
let models = res.data.modelList;
let models = this.returnReadyModels(res.data.modelList)
const link = res.data.nextLink;

const recentModelIds = this.getRecentModelIds(recentModels);
Expand Down Expand Up @@ -470,7 +472,7 @@ export default class ModelComposePage extends React.Component<IModelComposePageP
private getModelsFromNextLink = async (link: string) => {
const res = await this.getResponse(link);
return {
nextList: res.data.modelList,
nextList: this.returnReadyModels(res.data.modelList),
nextLink: res.data.nextLink,
};
}
Expand Down

0 comments on commit 0e1b637

Please sign in to comment.