PluginProbe
SchedulePress – Auto Post & Publish, Auto Social Share, Schedule Posts with Editorial Calendar & Missed Schedule Post Publisher / trunk
SchedulePress – Auto Post & Publish, Auto Social Share, Schedule Posts with Editorial Calendar & Missed Schedule Post Publisher vtrunk
5.3.4 5.3.3 5.3.2 5.3.1 5.3.0 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.10 5.2.11 5.2.12 5.2.13 5.2.14 5.2.15 5.2.16 5.2.17 5.2.18 5.2.2 5.2.3 All 118 releases
wp-scheduled-posts / src / context / AppReducer.js

AppReducer.js in SchedulePress – Auto Post & Publish, Auto Social Share, Schedule Posts with Editorial Calendar & Missed Schedule Post Publisher trunk, at src/context/AppReducer.js

84 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const AppReducer = (state, action) => {
2 switch (action.type) {
3 case 'SET_CUSTOM_SOCIAL_MESSAGE_MODAL':
4 return {
5 ...state,
6 isOpenCustomSocialMessageModal: action.payload,
7 };
8 case 'SET_AUTO_OPEN_AI_CAPTION':
9 return {
10 ...state,
11 autoOpenAICaption: action.payload,
12 };
13 case 'SET_OPEN_PRO_POPUP':
14 return {
15 ...state,
16 isOpenProPopup: action.payload,
17 };
18 case 'SET_PUBLISH_IMMEDIATELY':
19 return {
20 ...state,
21 publishImmediately: action.payload,
22 };
23 case 'SET_UNPUBLISH_ON':
24 return {
25 ...state,
26 unpublishOn: action.payload,
27 };
28 case 'SET_REPUBLISH_ON':
29 return {
30 ...state,
31 republishOn: action.payload,
32 };
33 case 'SET_ADVANCED_SCHEDULE':
34 return {
35 ...state,
36 advancedSchedule: action.payload,
37 };
38 case 'SET_ADVANCED_SCHEDULE_DATE':
39 return {
40 ...state,
41 advancedScheduleDate: action.payload,
42 };
43 case 'SET_IS_SCHEDULED':
44 return {
45 ...state,
46 isScheduled: action.payload,
47 };
48 case 'SET_SCHEDULE_TYPE':
49 return {
50 ...state,
51 scheduleType: action.payload,
52 };
53 case 'SET_SCHEDULE_DATE':
54 // Payload may be a plain date string (legacy callers) or an object
55 // `{ value, source }` where source is 'publish' | 'auto' | 'manual'.
56 // Tracking the source lets sibling pickers ignore updates that didn't
57 // originate from them, so e.g. picking a Publish On date doesn't
58 // visibly change the Auto / Manual selectors.
59 if (action.payload && typeof action.payload === 'object') {
60 return {
61 ...state,
62 scheduleDate: action.payload.value,
63 scheduleDateSource: action.payload.source || '',
64 };
65 }
66 return {
67 ...state,
68 scheduleDate: action.payload,
69 };
70 case 'SET_SOCIAL_SHARE_SETTINGS':
71 return {
72 ...state,
73 socialShareSettings: {
74 ...state.socialShareSettings,
75 ...action.payload,
76 },
77 };
78 default:
79 return state;
80 }
81 };
82
83 export default AppReducer;
84