Added timeline dequeue functionality to onSubmitCompose action
when a status is composed and there's queued statuses, it attempts to dequeue those statuses with optional dequeueArgs
This commit is contained in:
parent
0356e21747
commit
ebc44ed743
|
@ -6,7 +6,7 @@ import { tagHistory } from '../settings';
|
|||
import { useEmoji } from './emojis';
|
||||
import resizeImage from '../utils/resize_image';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { updateTimeline } from './timelines';
|
||||
import { updateTimeline, dequeueTimeline } from './timelines';
|
||||
import { showAlertForError } from './alerts';
|
||||
import { showAlert } from './alerts';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
@ -168,6 +168,10 @@ export function submitCompose(routerHistory) {
|
|||
const timeline = getState().getIn(['timelines', timelineId]);
|
||||
|
||||
if (timeline && timeline.get('items').size > 0 && timeline.getIn(['items', 0]) !== null && timeline.get('online')) {
|
||||
let dequeueArgs = {};
|
||||
if (timelineId === 'community') dequeueArgs.onlyMedia = getState().getIn(['settings', 'community', 'other', 'onlyMedia']),
|
||||
|
||||
dispatch(dequeueTimeline(timelineId, null, dequeueArgs));
|
||||
dispatch(updateTimeline(timelineId, { ...response.data }));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue