Progress, Deck done
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
import { me } from '../initial_state'
|
||||
import {
|
||||
CHAT_CONVERSATION_CREATE_SEARCH_ACCOUNTS_SUCCESS,
|
||||
CLEAR_CHAT_CONVERSATION_CREATE_SEARCH_ACCOUNTS,
|
||||
SET_CHAT_CONVERSATION_SELECTED,
|
||||
} from '../actions/chats'
|
||||
import {
|
||||
@@ -29,6 +30,8 @@ export default function chats(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case CHAT_CONVERSATION_CREATE_SEARCH_ACCOUNTS_SUCCESS:
|
||||
return state.set('createChatConversationSuggestionIds', ImmutableList(action.accounts.map((item) => item.id)))
|
||||
case CLEAR_CHAT_CONVERSATION_CREATE_SEARCH_ACCOUNTS:
|
||||
return state.set('createChatConversationSuggestionIds', ImmutableList())
|
||||
case SET_CHAT_CONVERSATION_SELECTED:
|
||||
return state.set('selectedChatConversationId', action.chatConversationId)
|
||||
case CHAT_CONVERSATION_REQUESTED_COUNT_FETCH_SUCCESS:
|
||||
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
COMPOSE_EXPIRES_AT_CHANGE,
|
||||
COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY,
|
||||
COMPOSE_CLEAR,
|
||||
COMPOSE_GROUP_SET,
|
||||
} from '../actions/compose';
|
||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||
import { STORE_HYDRATE } from '../actions/store';
|
||||
@@ -62,6 +63,7 @@ const initialState = ImmutableMap({
|
||||
preselectDate: null,
|
||||
in_reply_to: null,
|
||||
quote_of_id: null,
|
||||
group_id: null,
|
||||
is_composing: false,
|
||||
is_submitting: false,
|
||||
is_changing_upload: false,
|
||||
@@ -119,6 +121,7 @@ function clearAll(state) {
|
||||
map.set('expires_at', null);
|
||||
map.set('rte_controls_visible', false);
|
||||
map.set('gif', false);
|
||||
map.set('group_id', null);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -305,6 +308,7 @@ export default function compose(state = initialState, action) {
|
||||
map.set('id', null);
|
||||
map.set('quote_of_id', null);
|
||||
map.set('in_reply_to', null);
|
||||
map.set('group_id', null);
|
||||
map.set('text', '');
|
||||
map.set('spoiler', false);
|
||||
map.set('spoiler_text', '');
|
||||
@@ -414,6 +418,8 @@ export default function compose(state = initialState, action) {
|
||||
return state.withMutations(map => {
|
||||
map.set('rte_controls_visible', action.open || !state.get('rte_controls_visible'));
|
||||
});
|
||||
case COMPOSE_GROUP_SET:
|
||||
return state.set('group_id', action.groupId);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import {
|
||||
DECK_CONNECT,
|
||||
DECK_DISCONNECT,
|
||||
DECK_SEARCH_USERS_CLEAR,
|
||||
DECK_SEARCH_USERS_SUCCESS,
|
||||
} from '../actions/deck'
|
||||
import { Map as ImmutableMap } from 'immutable'
|
||||
import {
|
||||
Map as ImmutableMap,
|
||||
List as ImmutableList,
|
||||
} from 'immutable'
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
connected: false,
|
||||
accountSuggestions: ImmutableList(),
|
||||
})
|
||||
|
||||
export default function deck(state = initialState, action) {
|
||||
@@ -14,6 +20,10 @@ export default function deck(state = initialState, action) {
|
||||
return state.set('connected', true)
|
||||
case DECK_DISCONNECT:
|
||||
return state.set('connected', false)
|
||||
case DECK_SEARCH_USERS_SUCCESS:
|
||||
return state.set('accountSuggestions', ImmutableList(action.accounts.map((item) => item.id)))
|
||||
case DECK_SEARCH_USERS_CLEAR:
|
||||
return state.set('accountSuggestions', ImmutableList())
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user