|
|
|
@ -21,7 +21,7 @@ import {
|
|
|
|
|
COMPOSE_TAG_HISTORY_UPDATE,
|
|
|
|
|
COMPOSE_SENSITIVITY_CHANGE,
|
|
|
|
|
COMPOSE_SPOILERNESS_CHANGE,
|
|
|
|
|
COMPOSE_MARKDOWN_CHANGE,
|
|
|
|
|
COMPOSE_TYPE_CHANGE,
|
|
|
|
|
COMPOSE_SPOILER_TEXT_CHANGE,
|
|
|
|
|
COMPOSE_VISIBILITY_CHANGE,
|
|
|
|
|
COMPOSE_COMPOSING_CHANGE,
|
|
|
|
@ -51,7 +51,7 @@ const initialState = ImmutableMap({
|
|
|
|
|
sensitive: false,
|
|
|
|
|
spoiler: false,
|
|
|
|
|
spoiler_text: '',
|
|
|
|
|
markdown: true,
|
|
|
|
|
content_type: 'text/markdown',
|
|
|
|
|
privacy: null,
|
|
|
|
|
text: '',
|
|
|
|
|
focusDate: null,
|
|
|
|
@ -96,7 +96,7 @@ function clearAll(state) {
|
|
|
|
|
map.set('text', '');
|
|
|
|
|
map.set('spoiler', false);
|
|
|
|
|
map.set('spoiler_text', '');
|
|
|
|
|
map.set('markdown', true);
|
|
|
|
|
map.set('content_type', 'text/markdown');
|
|
|
|
|
map.set('is_submitting', false);
|
|
|
|
|
map.set('is_changing_upload', false);
|
|
|
|
|
map.set('in_reply_to', null);
|
|
|
|
@ -218,9 +218,9 @@ export default function compose(state = initialState, action) {
|
|
|
|
|
|
|
|
|
|
map.set('idempotencyKey', uuid());
|
|
|
|
|
});
|
|
|
|
|
case COMPOSE_MARKDOWN_CHANGE:
|
|
|
|
|
case COMPOSE_TYPE_CHANGE:
|
|
|
|
|
return state.withMutations(map => {
|
|
|
|
|
map.set('markdown', !state.get('markdown'));
|
|
|
|
|
map.set('content_type', action.value);
|
|
|
|
|
map.set('idempotencyKey', uuid());
|
|
|
|
|
});
|
|
|
|
|
case COMPOSE_SPOILERNESS_CHANGE:
|
|
|
|
@ -251,7 +251,7 @@ export default function compose(state = initialState, action) {
|
|
|
|
|
map.set('focusDate', new Date());
|
|
|
|
|
map.set('caretPosition', null);
|
|
|
|
|
map.set('idempotencyKey', uuid());
|
|
|
|
|
map.set('markdown', true);
|
|
|
|
|
map.set('content_type', 'text/markdown');
|
|
|
|
|
|
|
|
|
|
if (action.status.get('spoiler_text', '').length > 0) {
|
|
|
|
|
map.set('spoiler', true);
|
|
|
|
@ -335,7 +335,7 @@ export default function compose(state = initialState, action) {
|
|
|
|
|
map.set('focusDate', new Date());
|
|
|
|
|
map.set('caretPosition', null);
|
|
|
|
|
map.set('idempotencyKey', uuid());
|
|
|
|
|
map.set('markdown', true);
|
|
|
|
|
map.set('content_type', 'text/markdown');
|
|
|
|
|
|
|
|
|
|
if (action.status.get('spoiler_text').length > 0) {
|
|
|
|
|
map.set('spoiler', true);
|
|
|
|
|