pendingStatus: fix crash when replying to self

This commit is contained in:
Alex Gleason 2022-02-19 22:49:12 -05:00
parent 4e441a5d0f
commit 1130373c02
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ export function submitCompose(routerHistory, force = false) {
const status = state.getIn(['compose', 'text'], ''); const status = state.getIn(['compose', 'text'], '');
const media = state.getIn(['compose', 'media_attachments']); const media = state.getIn(['compose', 'media_attachments']);
let to = state.getIn(['compose', 'to'], null); let to = state.getIn(['compose', 'to']);
if (!validateSchedule(state)) { if (!validateSchedule(state)) {
dispatch(snackbar.error(messages.scheduleError)); dispatch(snackbar.error(messages.scheduleError));

View File

@ -428,7 +428,7 @@ export default function compose(state = initialState, action) {
case REDRAFT: case REDRAFT:
return state.withMutations(map => { return state.withMutations(map => {
map.set('text', action.raw_text || unescapeHTML(expandMentions(action.status))); map.set('text', action.raw_text || unescapeHTML(expandMentions(action.status)));
map.set('to', action.explicitAddressing ? getExplicitMentions(action.status.get('account', 'id'), action.status) : null); map.set('to', action.explicitAddressing ? getExplicitMentions(action.status.get('account', 'id'), action.status) : undefined);
map.set('in_reply_to', action.status.get('in_reply_to_id')); map.set('in_reply_to', action.status.get('in_reply_to_id'));
map.set('privacy', action.status.get('visibility')); map.set('privacy', action.status.get('visibility'));
// TODO: Actually fix this rather than just removing it // TODO: Actually fix this rather than just removing it