This commit is contained in:
mgabdev
2020-04-22 01:00:11 -04:00
parent 4d7aee59c9
commit fed036be08
46 changed files with 883 additions and 1134 deletions

View File

@@ -54,7 +54,7 @@ const initialState = ImmutableMap({
spoiler_text: '',
privacy: null,
text: '',
markdown_text: '',
markdown: null,
focusDate: null,
caretPosition: null,
preselectDate: null,
@@ -248,6 +248,7 @@ export default function compose(state = initialState, action) {
case COMPOSE_CHANGE:
return state
.set('text', action.text)
.set('markdown', action.markdown)
.set('idempotencyKey', uuid());
case COMPOSE_COMPOSING_CHANGE:
return state.set('is_composing', action.value);

View File

@@ -1,16 +1,19 @@
import {
ACCOUNT_BLOCK_SUCCESS,
ACCOUNT_MUTE_SUCCESS,
} from '../actions/accounts';
import { CONTEXT_FETCH_SUCCESS } from '../actions/statuses';
import { TIMELINE_DELETE, TIMELINE_UPDATE } from '../actions/timelines';
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
import compareId from '../utils/compare_id';
} from '../actions/accounts'
import {
COMMENTS_FETCH_SUCCESS,
CONTEXT_FETCH_SUCCESS,
} from '../actions/statuses'
import { TIMELINE_DELETE, TIMELINE_UPDATE } from '../actions/timelines'
import { Map as ImmutableMap, List as ImmutableList } from 'immutable'
import compareId from '../utils/compare_id'
const initialState = ImmutableMap({
inReplyTos: ImmutableMap(),
replies: ImmutableMap(),
});
})
const normalizeContext = (immutableState, id, ancestors, descendants) => immutableState.withMutations(state => {
state.update('inReplyTos', immutableAncestors => immutableAncestors.withMutations(inReplyTos => {
@@ -96,6 +99,8 @@ export default function replies(state = initialState, action) {
return filterContexts(state, action.relationship, action.statuses);
case CONTEXT_FETCH_SUCCESS:
return normalizeContext(state, action.id, action.ancestors, action.descendants);
case COMMENTS_FETCH_SUCCESS:
return normalizeContext(state, action.id, ImmutableList(), action.descendants);
case TIMELINE_DELETE:
return deleteFromContexts(state, [action.id]);
case TIMELINE_UPDATE: