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 e69d5a74ae
commit c0a5462a56

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,