diff --git a/src/_components/modals/AddSshKey.vue b/src/_components/modals/AddSshKey.vue index 587cd91..d092ad4 100644 --- a/src/_components/modals/AddSshKey.vue +++ b/src/_components/modals/AddSshKey.vue @@ -134,6 +134,13 @@ export default { show() { this.$modal.show('add-ssh-key'); + + this.name = ''; + this.sshPublicKey = ''; + this.minExpiration = new Date().toISOString(); + this.expiration = null; + this.timezone = this.detectedTimezone.timeZoneId; + this.submitted = false; }, hide() { this.$modal.hide('add-ssh-key'); diff --git a/src/_store/users.module.js b/src/_store/users.module.js index 442ab56..64307a5 100644 --- a/src/_store/users.module.js +++ b/src/_store/users.module.js @@ -144,8 +144,14 @@ const actions = { commit('addSshKeyByUserIdRequest'); return userService.addSshKeyByUserId(userId, sshKey, messages, errors) .then( - key => commit('addSshKeyByUserIdSuccess', key), - error => commit('addSshKeyByUserIdFailure', error) + key => { + commit('addSshKeyByUserIdSuccess', key); + return Promise.resolve(); + }, + error => { + commit('addSshKeyByUserIdFailure', error); + return Promise.reject(); + } ); },