mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 03:42:10 +03:00
set scedule date to null when schedule status changed
This commit is contained in:
parent
31ee6ef52f
commit
16f4e2c453
@ -79,7 +79,7 @@ const PostOptionsModal = forwardRef(({
|
|||||||
handleScheduleChange(scheduledFor)
|
handleScheduleChange(scheduledFor)
|
||||||
}
|
}
|
||||||
}, [scheduleLater, scheduledFor])
|
}, [scheduleLater, scheduledFor])
|
||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(scheduledFor){
|
if(scheduledFor){
|
||||||
handleScheduleChange(scheduledFor);
|
handleScheduleChange(scheduledFor);
|
||||||
@ -87,9 +87,12 @@ const PostOptionsModal = forwardRef(({
|
|||||||
},[scheduledFor])
|
},[scheduledFor])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(scheduledForDate){
|
if (scheduledForDate) {
|
||||||
setScheduleLater(true);
|
setScheduleLater(true);
|
||||||
setScheduledFor(scheduledForDate);
|
setScheduledFor(scheduledForDate);
|
||||||
|
} else {
|
||||||
|
setScheduleLater(false);
|
||||||
|
setScheduledFor('');
|
||||||
}
|
}
|
||||||
},[scheduledForDate])
|
},[scheduledForDate])
|
||||||
|
|
||||||
@ -155,8 +158,11 @@ const PostOptionsModal = forwardRef(({
|
|||||||
intl.formatMessage({id:"editor.scheduled_later"}),
|
intl.formatMessage({id:"editor.scheduled_later"}),
|
||||||
]}
|
]}
|
||||||
selectedOptionIndex={scheduleLater ? 1 : 0}
|
selectedOptionIndex={scheduleLater ? 1 : 0}
|
||||||
handleOnChange={(index)=>{
|
handleOnChange={(index)=> {
|
||||||
setScheduleLater(index === 1)
|
setScheduleLater(index === 1);
|
||||||
|
if (index !== 1) {
|
||||||
|
handleScheduleChange(null);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user