mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-29 11:12:18 +03:00
added action to update other account
This commit is contained in:
parent
905c39707d
commit
1f97de29da
@ -7,6 +7,7 @@ import {
|
||||
SET_GLOBAL_PROPS,
|
||||
UPDATE_CURRENT_ACCOUNT,
|
||||
UPDATE_UNREAD_ACTIVITY_COUNT,
|
||||
UPDATE_OTHER_ACCOUNT,
|
||||
} from '../constants/constants';
|
||||
|
||||
export const fetchGlobalProperties = () => (dispatch) =>
|
||||
@ -27,6 +28,11 @@ export const addOtherAccount = (data) => ({
|
||||
payload: data,
|
||||
});
|
||||
|
||||
export const updateOtherAccount = (accountObj) => ({
|
||||
type: UPDATE_OTHER_ACCOUNT,
|
||||
payload: accountObj
|
||||
})
|
||||
|
||||
export const failedAccount = (data) => ({
|
||||
type: FETCH_ACCOUNT_FAIL,
|
||||
payload: data,
|
||||
|
@ -41,6 +41,7 @@ export const SET_ENC_UNLOCK_PIN = 'SET_ENC_UNLOCK_PIN';
|
||||
|
||||
// Accounts
|
||||
export const ADD_OTHER_ACCOUNT = 'ADD_OTHER_ACCOUNT';
|
||||
export const UPDATE_OTHER_ACCOUNT = 'UPDATE_OTHER_ACCOUNT';
|
||||
export const FETCH_ACCOUNT_FAIL = 'FETCH_ACCOUNT_FAIL';
|
||||
export const FETCHING_ACCOUNT = 'FETCHING_ACCOUNT';
|
||||
export const REMOVE_OTHER_ACCOUNT = 'REMOVE_OTHER_ACCOUNT';
|
||||
|
@ -4,6 +4,7 @@ import {
|
||||
FETCH_ACCOUNT_FAIL,
|
||||
FETCHING_ACCOUNT,
|
||||
ADD_OTHER_ACCOUNT,
|
||||
UPDATE_OTHER_ACCOUNT,
|
||||
UPDATE_CURRENT_ACCOUNT,
|
||||
UPDATE_UNREAD_ACTIVITY_COUNT,
|
||||
REMOVE_OTHER_ACCOUNT,
|
||||
@ -78,6 +79,17 @@ export default function (state = initialState, action) {
|
||||
errorMessage: null,
|
||||
};
|
||||
|
||||
|
||||
case UPDATE_OTHER_ACCOUNT:
|
||||
return {
|
||||
...state,
|
||||
otherAccounts: [
|
||||
...state.otherAccounts.filter(
|
||||
(item) => item.username !== action.payload.username),
|
||||
action.payload
|
||||
],
|
||||
}
|
||||
|
||||
case REMOVE_OTHER_ACCOUNT:
|
||||
return {
|
||||
...state,
|
||||
|
Loading…
Reference in New Issue
Block a user