[Glitch] Fix issues with sending direct messages from user profile

Port 4fd71accd4 to glitch-soc
This commit is contained in:
Thibaut Girka 2018-04-02 17:15:29 +02:00
parent a5fac975f3
commit fb6de5310d
2 changed files with 7 additions and 2 deletions

View file

@ -328,7 +328,7 @@ export default function compose(state = initialState, action) {
.set('idempotencyKey', uuid()); .set('idempotencyKey', uuid());
case COMPOSE_DIRECT: case COMPOSE_DIRECT:
return state return state
.update('text', text => `${text}@${action.account.get('acct')} `) .update('text', text => `@${action.account.get('acct')} `)
.set('privacy', 'direct') .set('privacy', 'direct')
.set('focusDate', new Date()) .set('focusDate', new Date())
.set('idempotencyKey', uuid()); .set('idempotencyKey', uuid());

View file

@ -4,7 +4,11 @@ import {
SEARCH_FETCH_SUCCESS, SEARCH_FETCH_SUCCESS,
SEARCH_SHOW, SEARCH_SHOW,
} from 'flavours/glitch/actions/search'; } from 'flavours/glitch/actions/search';
import { COMPOSE_MENTION, COMPOSE_REPLY } from 'flavours/glitch/actions/compose'; import {
COMPOSE_MENTION,
COMPOSE_REPLY,
COMPOSE_DIRECT,
} from 'flavours/glitch/actions/compose';
import { Map as ImmutableMap, List as ImmutableList } from 'immutable'; import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
const initialState = ImmutableMap({ const initialState = ImmutableMap({
@ -29,6 +33,7 @@ export default function search(state = initialState, action) {
return state.set('hidden', false); return state.set('hidden', false);
case COMPOSE_REPLY: case COMPOSE_REPLY:
case COMPOSE_MENTION: case COMPOSE_MENTION:
case COMPOSE_DIRECT:
return state.set('hidden', true); return state.set('hidden', true);
case SEARCH_FETCH_SUCCESS: case SEARCH_FETCH_SUCCESS:
return state.set('results', ImmutableMap({ return state.set('results', ImmutableMap({