Skip to content

Commit

Permalink
yarn test:lint:js --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
takayamaki committed Oct 5, 2023
1 parent ffaf713 commit a426db2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
4 changes: 3 additions & 1 deletion app/javascript/mastodon/components/avatar_overlay_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const icons = {
};

export default class AvatarOverlayIcon extends React.PureComponent {

static propTypes = {
account: ImmutablePropTypes.map.isRequired,
visibility: PropTypes.string.isRequired,
Expand All @@ -23,7 +24,7 @@ export default class AvatarOverlayIcon extends React.PureComponent {

render() {
const { account, visibility, animate } = this.props;
const icon = icons[visibility]
const icon = icons[visibility];

const baseStyle = {
backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,
Expand All @@ -36,4 +37,5 @@ export default class AvatarOverlayIcon extends React.PureComponent {
</div>
);
}

}
7 changes: 3 additions & 4 deletions app/javascript/mastodon/components/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import Avatar from './avatar';
import AvatarOverlay from './avatar_overlay';
import AvatarOverlayIcon from './avatar_overlay_icon';
import AvatarComposite from './avatar_composite';
import RelativeTimestamp from './relative_timestamp';
import DisplayName from './display_name';
import StatusContent from './status_content';
Expand Down Expand Up @@ -491,10 +490,10 @@ class Status extends ImmutablePureComponent {
);
}

if (account == null && status.get('visibility') === 'public') {
if (account === null && status.get('visibility') === 'public') {
statusAvatar = <Avatar account={status.get('account')} size={46} />;
} else if (account == null) {
statusAvatar = <AvatarOverlayIcon account={status.get('account')} visibility={status.get('visibility')} />
} else if (account === null) {
statusAvatar = <AvatarOverlayIcon account={status.get('account')} visibility={status.get('visibility')} />;
} else {
statusAvatar = <AvatarOverlay account={status.get('account')} friend={account} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ComposeForm extends ImmutablePureComponent {
this.autosuggestTextarea.textarea.focus();
}).catch(console.error);
} else if(prevProps.isSubmitting && !this.props.isSubmitting) {
this.autosuggestTextarea.textarea.setSelectionRange(0, 0)
this.autosuggestTextarea.textarea.setSelectionRange(0, 0);
this.autosuggestTextarea.textarea.focus();
} else if (this.props.spoiler !== prevProps.spoiler) {
if (this.props.spoiler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FavouriteTags extends React.PureComponent {
const icon = icons.concat().reverse().find(icon => nextState.lockedVisibility.includes(icon.key));
this.execLockTag(
nextState.lockedTag.join(' '),
typeof icon === 'undefined' ? '' : icon.key
typeof icon === 'undefined' ? '' : icon.key,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Button from '../../../components/button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';

const messages = defineMessages({
add_favourite_tags_public: { id: 'tag.add_favourite.public', defaultMessage: 'add in the favourite tags (Public)' },
Expand Down Expand Up @@ -45,7 +45,7 @@ export default class FavouriteToggle extends React.PureComponent {
<div className='column-settings__row'>
<Button className='favourite-tags__remove-button-in-column' text={intl.formatMessage(messages.remove_favourite_tags)} onClick={this.removeFavouriteTags} block />
</div>
:
:
<div className='column-settings__row'>
<Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_public)} onClick={this.addPublic} block />
<Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_unlisted)} onClick={this.addUnlisted} block />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const messages = defineMessages({
followsAndFollowers: { id: 'navigation_bar.follows_and_followers', defaultMessage: 'Follows and followers' },
about: { id: 'navigation_bar.about', defaultMessage: 'About' },
search: { id: 'navigation_bar.search', defaultMessage: 'Search' },
faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ'}
faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ' },
});

export default @injectIntl
Expand Down Expand Up @@ -93,7 +93,7 @@ class NavigationPanel extends React.Component {
<hr />

<ColumnLink transparent href='/settings/preferences' icon='cog' text={intl.formatMessage(messages.preferences)} />
<ColumnLink transparent href='https://faq.imastodon.net/getting-started/' icon='question' text={intl.formatMessage(messages.faq)} targetWindow="_blank" />
<ColumnLink transparent href='https://faq.imastodon.net/getting-started/' icon='question' text={intl.formatMessage(messages.faq)} targetWindow='_blank' />

<hr />

Expand All @@ -108,7 +108,7 @@ class NavigationPanel extends React.Component {

<NavigationPortal />


</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/reducers/trend_tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TREND_TAGS_SUCCESS,
TREND_TAGS_HISTORY_SUCCESS,
TOGGLE_TREND_TAGS
TOGGLE_TREND_TAGS,
} from '../actions/trend_tags';
import Immutable from 'immutable';

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/reducers/user_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
FOLLOW_REQUESTS_EXPAND_FAIL,
FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
FOLLOW_REQUEST_REJECT_SUCCESS,
} from '../actions/accounts';
} from '../actions/accounts';
import {
REBLOGS_FETCH_SUCCESS,
FAVOURITES_FETCH_SUCCESS,
Expand Down
6 changes: 3 additions & 3 deletions streaming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ const startWorker = async (workerId) => {
// If the payload already contains the `filtered` property, it means
// that filtering has been applied on the ruby on rails side, as
// such, we don't need to construct or apply the filters in streaming:
if (Object.prototype.hasOwnProperty.call(payload, "filtered")) {
if (Object.prototype.hasOwnProperty.call(payload, 'filtered')) {
transmit(event, payload);
return;
}
Expand Down Expand Up @@ -815,7 +815,7 @@ const startWorker = async (workerId) => {
results.push({
filter: cachedFilter.filter,
keyword_matches,
status_matches: null
status_matches: null,
});
}

Expand All @@ -830,7 +830,7 @@ const startWorker = async (workerId) => {
// filtered: https://docs.joinmastodon.org/entities/Status/#filtered
transmit(event, {
...payload,
filtered: filter_results
filtered: filter_results,
});
} else {
transmit(event, payload);
Expand Down

0 comments on commit a426db2

Please sign in to comment.