Skip to content

Commit

Permalink
fix: Create runtime credential not reset last credential (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnywx authored Jan 30, 2019
1 parent eabd2fd commit 6e2daf4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/Dashboard/Runtimes/Create/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ export default class CreateTestingEnv extends React.Component {
}

componentWillUnmount() {
const { rootStore, createEnvStore } = this.props;
const { rootStore, createEnvStore, credentialStore } = this.props;
createEnvStore.reset();
rootStore.clearNotify();
credentialStore.reset();
}

@computed
Expand Down
7 changes: 7 additions & 0 deletions src/stores/runtime/credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,11 @@ export default class RuntimeCredentialStore extends Store {
this.isLoading = false;
return this.runtimeZones;
};

reset = () => {
this.credentials = [];
this.credential = {};
this.runtimeZones = [];
this.credentialCount = 0;
};
}

0 comments on commit 6e2daf4

Please sign in to comment.