Skip to content

Commit

Permalink
fix(docker): Allow auto-switch to manual entry when refreshing images (
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmquach committed Jun 17, 2019
1 parent c88234c commit 8358010
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class DockerImageAndTagSelector extends React.Component<
}
}

private updateThings(props: IDockerImageAndTagSelectorProps) {
private updateThings(props: IDockerImageAndTagSelectorProps, allowAutoSwitchToManualEntry = false) {
if (!this.repositoryMap) {
return;
}
Expand Down Expand Up @@ -276,7 +276,11 @@ export class DockerImageAndTagSelector extends React.Component<
tagOptions: tags.sort().map(t => ({ label: t, value: t })),
} as IDockerImageAndTagSelectorState;

if (imageId && !this.state.imagesLoaded && (!organizationFound || !repositoryFound || !tagFound)) {
if (
imageId &&
(!this.state.imagesLoaded || allowAutoSwitchToManualEntry) &&
(!organizationFound || !repositoryFound || !tagFound)
) {
newState.defineManually = true;

const missingFields: string[] = [];
Expand Down Expand Up @@ -327,7 +331,7 @@ export class DockerImageAndTagSelector extends React.Component<
this.organizationMap = this.getOrganizationMap(this.images);
this.repositoryMap = this.getRepositoryMap(this.images);
this.organizations = this.getOrganizationsList(this.accountMap);
this.updateThings(props);
this.updateThings(props, true);
})
.finally(() => {
this.setState({
Expand Down

0 comments on commit 8358010

Please sign in to comment.