From 5791a5225b0f52e4a1f1ee972be5eb618139e33a Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 14 Jul 2020 18:46:43 -0500 Subject: [PATCH] Updated ComposeForm, GroupPage to use groupId instead of entire group for prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - ComposeForm, GroupPage to use groupId instead of entire group for prop --- .../gabsocial/features/compose/components/compose_form.js | 5 ++--- app/javascript/gabsocial/pages/group_page.js | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/gabsocial/features/compose/components/compose_form.js b/app/javascript/gabsocial/features/compose/components/compose_form.js index e1675eab..c5f4005a 100644 --- a/app/javascript/gabsocial/features/compose/components/compose_form.js +++ b/app/javascript/gabsocial/features/compose/components/compose_form.js @@ -80,7 +80,7 @@ class ComposeForm extends ImmutablePureComponent { anyMedia: PropTypes.bool, shouldCondense: PropTypes.bool, autoFocus: PropTypes.bool, - group: ImmutablePropTypes.map, + groupId: PropTypes.string, isModalOpen: PropTypes.bool, scheduledAt: PropTypes.instanceOf(Date), setScheduledAt: PropTypes.func.isRequired, @@ -142,14 +142,13 @@ class ComposeForm extends ImmutablePureComponent { // } // 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(''); if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > MAX_POST_CHARACTER_COUNT || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) { return; } - const groupId = group ? group.get('id') : undefined this.props.onSubmit(groupId, this.props.replyToId, this.context.router); } diff --git a/app/javascript/gabsocial/pages/group_page.js b/app/javascript/gabsocial/pages/group_page.js index 28368088..85bb2686 100644 --- a/app/javascript/gabsocial/pages/group_page.js +++ b/app/javascript/gabsocial/pages/group_page.js @@ -49,6 +49,7 @@ class GroupPage extends ImmutablePureComponent { } = this.props const groupTitle = !!group ? group.get('title') : '' + const groupId = !!group ? group.get('id') : undefined return ( - + }