Fixed adding same user name for other account issue

This commit is contained in:
Mustafa Buyukcelebi 2019-07-22 14:37:40 +03:00
parent 8543fe5d95
commit b15add64fe

View File

@ -45,7 +45,9 @@ export default function(state = initialState, action) {
case ADD_OTHER_ACCOUNT:
return {
...state,
otherAccounts: [...state.otherAccounts, action.payload],
otherAccounts: state.otherAccounts.some(item => item.username === action.payload.username)
? [...state.otherAccounts]
: [...state.otherAccounts, action.payload],
isFetching: false,
hasError: false,
errorMessage: null,