added redux entry for selected feed filters

This commit is contained in:
Nouman Tahir 2021-04-21 05:40:34 +05:00
parent 29e61b4310
commit 16b82a1271
3 changed files with 18 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import {
SET_PIN_CODE,
IS_PIN_CODE_OPEN,
IS_RENDER_REQUIRED,
SET_FEED_SCREEN_FILTERS,
} from '../constants/constants';
export const login = (payload) => ({
@ -183,3 +184,8 @@ export const isRenderRequired = (payload) => ({
payload,
type: IS_RENDER_REQUIRED,
});
export const setFeedScreenFilters = (payload:string[]) => ({
payload,
type: SET_FEED_SCREEN_FILTERS
})

View File

@ -33,6 +33,7 @@ export const CHANGE_MENTION_NOTIFICATION = 'CHANGE_MENTION_NOTIFICATION';
export const CHANGE_REBLOG_NOTIFICATION = 'CHANGE_REBLOG_NOTIFICATION';
export const CHANGE_TRANSFERS_NOTIFICATION = 'CHANGE_TRANSFERS_NOTIFICATION';
export const CHANGE_ALL_NOTIFICATION_SETTINGS = 'CHANGE_ALL_NOTIFICATION_SETTINGS';
export const SET_FEED_SCREEN_FILTERS = 'SET_FEED_SCREEN_FILTERS';
// Accounts
export const ADD_OTHER_ACCOUNT = 'ADD_OTHER_ACCOUNT';

View File

@ -26,6 +26,7 @@ import {
SET_PIN_CODE,
IS_PIN_CODE_OPEN,
IS_RENDER_REQUIRED,
SET_FEED_SCREEN_FILTERS,
} from '../constants/constants';
const initialState = {
@ -61,6 +62,11 @@ const initialState = {
pin: null,
isPinCodeOpen: true,
isRenderRequired: false,
feedScreenfilters:[
'friends',
'communities',
'hot'
]
};
export default function (state = initialState, action) {
@ -211,6 +217,11 @@ export default function (state = initialState, action) {
return Object.assign({}, state, {
isRenderRequired: action.payload,
});
case SET_FEED_SCREEN_FILTERS:
return {
...state,
feedScreenFilters:action.payload
}
default:
return state;
}