Skip to content

Commit

Permalink
Fix bookmark of URLs with env
Browse files Browse the repository at this point in the history
For some reason, we'd always reset the env to the first available
once listing available envs, discarding the selection from the URL.
Fix it.

Fixes #3
  • Loading branch information
rohanpm committed Feb 3, 2019
1 parent 8c914cb commit 4292e6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pulpstatus/js-src/app-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,14 @@ export class AppBody extends React.Component<{}, AppBodyState> {
}

onEnvsFetched(envs: Array<string>) {
const selectedEnv =
(this.state.env && envs.indexOf(this.state.env) != -1)
? this.state.env
: envs[0];

this.setState({
availableEnvs: envs,
env: envs[0],
env: selectedEnv,
});
this.startTimer();
this.fetchData();
Expand Down

0 comments on commit 4292e6c

Please sign in to comment.