Skip to content

Commit

Permalink
fix(core/instance): Fix instance details loading on first click
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Mar 1, 2018
1 parent 990cd10 commit a035097
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ export class InstanceDetails extends React.Component<IInstanceDetailsProps, IIns
public componentDidMount() {
const { versionedCloudProviderService } = ReactInjector;

this.props$.next(this.props);
this.props$
.do(() => this.setState({ loading: true, accountId: null }))
.mergeMap(({ app, $stateParams }) => {
.switchMap(({ app, $stateParams }) => {
const acct = versionedCloudProviderService.getAccountForInstance($stateParams.provider, $stateParams.instanceId, app);
return Observable.fromPromise(acct);
})
.takeUntil(this.destroy$)
.subscribe((accountId: string) => {
this.setState({ accountId, loading: false })
});

this.props$.next(this.props);
}

public componentWillReceiveProps(nextProps: IInstanceDetailsProps) {
Expand Down

0 comments on commit a035097

Please sign in to comment.