diff --git a/app/src/reducers/ConnectionManager.ts b/app/src/reducers/ConnectionManager.ts index 56de274..6ffe4e2 100644 --- a/app/src/reducers/ConnectionManager.ts +++ b/app/src/reducers/ConnectionManager.ts @@ -187,10 +187,29 @@ function deleteConnection(state: ConnectionManagerState, action: DeleteConnectio function updateConnection(state: ConnectionManagerState, action: UpdateConnection): ConnectionManagerState { let connection = state.connections[action.connectionId] + let changeSet = action.changeSet + + // Reset empty username to undefined + if (changeSet.username !== undefined) { + changeSet = { + changeSet, + username: changeSet.username === '' ? undefined : changeSet.username, + } + } + + // Reset empty password to undefined + if (changeSet.password !== undefined) { + changeSet = { + changeSet, + username: changeSet.password === '' ? undefined : changeSet.password, + } + } + connection = { ...connection, - ...action.changeSet, + ...changeSet, } + return { ...state, connections: {