Skip to content

Commit

Permalink
単にロード中にデータ参照しただけでは?
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Oct 16, 2023
1 parent 2de0dbd commit 70e5d8a
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions app/javascript/mastodon/features/about/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ class About extends PureComponent {
const { multiColumn, intl, server, extendedDescription, domainBlocks } = this.props;
const isLoading = server.get('isLoading');

const fedibirdCapabilities = server.get('fedibird_capabilities') || [];
const fedibirdCapabilities = server.get('fedibird_capabilities') || []; // thinking about isLoading is true
const isPublicUnlistedVisibility = fedibirdCapabilities.includes('kmyblue_visibility_public_unlisted');
const isEmojiReaction = fedibirdCapabilities.includes('emoji_reaction');
const capabilitiesError = !server.get('fedibird_capabilities');

return (
<Column bindToDocument={!multiColumn} label={intl.formatMessage(messages.title)}>
Expand Down Expand Up @@ -193,22 +192,16 @@ class About extends PureComponent {
</Section>

<Section title={intl.formatMessage(messages.capabilities)}>
{capabilitiesError ? (
<p><FormattedMessage id='about.kmyblue_capability.error' defaultMessage='An error is occured! Please reload this page.' /></p>
) : (
<>
<p><FormattedMessage id='about.kmyblue_capability' defaultMessage='This server is using kmyblue, a fork of Mastodon. On this server, kmyblues unique features are configured as follows.' /></p>
{!isLoading && (
<ol className='rules-list'>
<li>
<span className='rules-list__text'>{intl.formatMessage(messages.emojiReaction)}: {intl.formatMessage(isEmojiReaction ? messages.enabled : messages.disabled)}</span>
</li>
<li>
<span className='rules-list__text'>{intl.formatMessage(messages.publicUnlistedVisibility)}: {intl.formatMessage(isPublicUnlistedVisibility ? messages.enabled : messages.disabled)}</span>
</li>
</ol>
)}
</>
<p><FormattedMessage id='about.kmyblue_capability' defaultMessage='This server is using kmyblue, a fork of Mastodon. On this server, kmyblues unique features are configured as follows.' /></p>
{!isLoading && (
<ol className='rules-list'>
<li>
<span className='rules-list__text'>{intl.formatMessage(messages.emojiReaction)}: {intl.formatMessage(isEmojiReaction ? messages.enabled : messages.disabled)}</span>
</li>
<li>
<span className='rules-list__text'>{intl.formatMessage(messages.publicUnlistedVisibility)}: {intl.formatMessage(isPublicUnlistedVisibility ? messages.enabled : messages.disabled)}</span>
</li>
</ol>
)}
</Section>

Expand Down

0 comments on commit 70e5d8a

Please sign in to comment.