Updated ComposeForm, GroupPage to use groupId instead of entire group for prop

• Updated:
- ComposeForm, GroupPage to use groupId instead of entire group for prop
This commit is contained in:
mgabdev 2020-07-14 18:46:43 -05:00
parent 745d8d8a55
commit 5791a5225b
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ class ComposeForm extends ImmutablePureComponent {
anyMedia: PropTypes.bool, anyMedia: PropTypes.bool,
shouldCondense: PropTypes.bool, shouldCondense: PropTypes.bool,
autoFocus: PropTypes.bool, autoFocus: PropTypes.bool,
group: ImmutablePropTypes.map, groupId: PropTypes.string,
isModalOpen: PropTypes.bool, isModalOpen: PropTypes.bool,
scheduledAt: PropTypes.instanceOf(Date), scheduledAt: PropTypes.instanceOf(Date),
setScheduledAt: PropTypes.func.isRequired, setScheduledAt: PropTypes.func.isRequired,
@ -142,14 +142,13 @@ class ComposeForm extends ImmutablePureComponent {
// } // }
// Submit disabled: // Submit disabled:
const { isSubmitting, isChangingUpload, isUploading, anyMedia, group } = this.props; const { isSubmitting, isChangingUpload, isUploading, anyMedia, groupId } = this.props;
const fulltext = [this.props.spoilerText, countableText(this.props.text)].join(''); const fulltext = [this.props.spoilerText, countableText(this.props.text)].join('');
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > MAX_POST_CHARACTER_COUNT || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) { if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > MAX_POST_CHARACTER_COUNT || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
return; return;
} }
const groupId = group ? group.get('id') : undefined
this.props.onSubmit(groupId, this.props.replyToId, this.context.router); this.props.onSubmit(groupId, this.props.replyToId, this.context.router);
} }

View File

@ -49,6 +49,7 @@ class GroupPage extends ImmutablePureComponent {
} = this.props } = this.props
const groupTitle = !!group ? group.get('title') : '' const groupTitle = !!group ? group.get('title') : ''
const groupId = !!group ? group.get('id') : undefined
return ( return (
<GroupLayout <GroupLayout
@ -62,7 +63,7 @@ class GroupPage extends ImmutablePureComponent {
{ {
!!relationships && relationships.get('member') && !!relationships && relationships.get('member') &&
<Fragment> <Fragment>
<TimelineComposeBlock size={46} group={group} autoFocus /> <TimelineComposeBlock size={46} groupId={groupId} autoFocus />
<Divider /> <Divider />
</Fragment> </Fragment>
} }