Skip to content

Commit

Permalink
Fixed bug with "Loading..." message when SSH key is empty.
Browse files Browse the repository at this point in the history
Bug: If there is no SSH key saved for user, then in OptionDialog "Loading..." message doesn't disappear
Fixes: #505
  • Loading branch information
bond95 committed Mar 12, 2018
1 parent 852ab59 commit 143a0ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/OptionsDialog/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ function* saveSSHKey (sagas, action) {
function* getSSHKey (sagas, action) {
yield put(setUnloaded())
const result = yield sagas.callExternalAction('getSSHKey', Api.getSSHKey, action)
if (!result.error && result.ssh_public_key && result.ssh_public_key.length > 0) {
if (result.error) {
return
}
if (result.ssh_public_key && result.ssh_public_key.length > 0) {
yield put(setSSHKey(Api.SSHKeyToInternal({ sshKey: result.ssh_public_key[0] })))
} else {
yield put(setSSHKey(Api.SSHKeyToInternal({ sshKey: '' })))
}
}

Expand Down

0 comments on commit 143a0ca

Please sign in to comment.