From 82130a1612854a213f0a5faba9b7eaed04d0c60e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 2 Apr 2022 13:07:12 -0500 Subject: [PATCH] StatusActionBar: remove a bunch of .get() calls --- app/soapbox/components/status_action_bar.tsx | 52 ++++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/soapbox/components/status_action_bar.tsx b/app/soapbox/components/status_action_bar.tsx index 558d96bb7..3900118e9 100644 --- a/app/soapbox/components/status_action_bar.tsx +++ b/app/soapbox/components/status_action_bar.tsx @@ -148,8 +148,8 @@ class StatusActionBar extends ImmutablePureComponent { navigator.share({ - text: this.props.status.get('search_index'), - url: this.props.status.get('url'), + text: this.props.status.search_index, + url: this.props.status.url, }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); @@ -256,22 +256,22 @@ class StatusActionBar extends ImmutablePureComponent = (e) => { e.stopPropagation(); - this.props.onMention(this.props.status.get('account'), this.props.history); + this.props.onMention(this.props.status.account, this.props.history); } handleDirectClick: React.EventHandler = (e) => { e.stopPropagation(); - this.props.onDirect(this.props.status.get('account'), this.props.history); + this.props.onDirect(this.props.status.account, this.props.history); } handleChatClick: React.EventHandler = (e) => { e.stopPropagation(); - this.props.onChat(this.props.status.get('account'), this.props.history); + this.props.onChat(this.props.status.account, this.props.history); } handleMuteClick: React.EventHandler = (e) => { e.stopPropagation(); - this.props.onMute(this.props.status.get('account')); + this.props.onMute(this.props.status.account); } handleBlockClick: React.EventHandler = (e) => { @@ -281,7 +281,7 @@ class StatusActionBar extends ImmutablePureComponent = (e) => { e.stopPropagation(); - this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('id')}`); + this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.id}`); } handleEmbed = () => { @@ -299,7 +299,7 @@ class StatusActionBar extends ImmutablePureComponent = (e) => { - const url = this.props.status.get('url'); + const { url } = this.props.status; const textarea = document.createElement('textarea'); e.stopPropagation(); @@ -332,7 +332,7 @@ class StatusActionBar extends ImmutablePureComponent = (e) => { @@ -364,7 +364,7 @@ class StatusActionBar extends ImmutablePureComponent { const { status, intl, withDismiss, me, features, isStaff, isAdmin } = this.props; - const mutingConversation = status.get('muted'); + const mutingConversation = status.muted; const ownAccount = status.getIn(['account', 'id']) === me; const username = String(status.getIn(['account', 'username'])); @@ -395,9 +395,9 @@ class StatusActionBar extends ImmutablePureComponent event.stopPropagation(), }); } menu.push({ - text: intl.formatMessage(status.get('sensitive') === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), + text: intl.formatMessage(status.sensitive === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), action: this.handleToggleStatusSensitivity, icon: require('@tabler/icons/icons/alert-triangle.svg'), }); @@ -558,11 +558,11 @@ class StatusActionBar extends ImmutablePureComponent, favouriteCount, @@ -583,9 +583,9 @@ class StatusActionBar extends ImmutablePureComponent