From 1130373c0207f76f9dc0ee2729992b6a9bf17f81 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 19 Feb 2022 22:49:12 -0500 Subject: [PATCH] pendingStatus: fix crash when replying to self --- app/soapbox/actions/compose.js | 2 +- app/soapbox/reducers/compose.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/actions/compose.js b/app/soapbox/actions/compose.js index 04b1c3cd7..3361188b6 100644 --- a/app/soapbox/actions/compose.js +++ b/app/soapbox/actions/compose.js @@ -219,7 +219,7 @@ export function submitCompose(routerHistory, force = false) { const status = state.getIn(['compose', 'text'], ''); const media = state.getIn(['compose', 'media_attachments']); - let to = state.getIn(['compose', 'to'], null); + let to = state.getIn(['compose', 'to']); if (!validateSchedule(state)) { dispatch(snackbar.error(messages.scheduleError)); diff --git a/app/soapbox/reducers/compose.js b/app/soapbox/reducers/compose.js index c0ee4af0b..57796af63 100644 --- a/app/soapbox/reducers/compose.js +++ b/app/soapbox/reducers/compose.js @@ -428,7 +428,7 @@ export default function compose(state = initialState, action) { case REDRAFT: return state.withMutations(map => { 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('privacy', action.status.get('visibility')); // TODO: Actually fix this rather than just removing it