---
+root: true
+
env:
browser: true
- node: false
+ node: true
es6: true
parser: babel-eslint
no-mixed-spaces-and-tabs: warn
no-nested-ternary: warn
no-trailing-spaces: warn
+ no-undef: error
no-unreachable: error
no-unused-expressions: error
+ no-unused-vars:
+ - error
+ - vars: all
+ args: after-used
+ ignoreRestSiblings: true
object-curly-spacing:
- error
- always
- 2
react/jsx-no-bind: error
react/jsx-no-duplicate-props: error
+ react/jsx-no-undef: error
react/jsx-tag-spacing: error
+ react/jsx-uses-react: error
+ react/jsx-uses-vars: error
react/jsx-wrap-multilines: error
react/no-multi-comp: off
react/no-string-refs: error
import api, { getLinks } from '../api';
-import Immutable from 'immutable';
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
export const ACCOUNT_FETCH_SUCCESS = 'ACCOUNT_FETCH_SUCCESS';
api(getState)
.post(`/api/v1/follow_requests/${id}/authorize`)
- .then(response => dispatch(authorizeFollowRequestSuccess(id)))
+ .then(() => dispatch(authorizeFollowRequestSuccess(id)))
.catch(error => dispatch(authorizeFollowRequestFail(id, error)));
};
};
api(getState)
.post(`/api/v1/follow_requests/${id}/reject`)
- .then(response => dispatch(rejectFollowRequestSuccess(id)))
+ .then(() => dispatch(rejectFollowRequestSuccess(id)))
.catch(error => dispatch(rejectFollowRequestFail(id, error)));
};
};
return (dispatch, getState) => {
dispatch(blockDomainRequest(domain));
- api(getState).post('/api/v1/domain_blocks', { domain }).then(response => {
+ api(getState).post('/api/v1/domain_blocks', { domain }).then(() => {
dispatch(blockDomainSuccess(domain, accountId));
}).catch(err => {
dispatch(blockDomainFail(domain, err));
return (dispatch, getState) => {
dispatch(unblockDomainRequest(domain));
- api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(response => {
+ api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(() => {
dispatch(unblockDomainSuccess(domain, accountId));
}).catch(err => {
dispatch(unblockDomainFail(domain, err));
export const NOTIFICATIONS_CLEAR = 'NOTIFICATIONS_CLEAR';
export const NOTIFICATIONS_SCROLL_TOP = 'NOTIFICATIONS_SCROLL_TOP';
-const messages = defineMessages({
+defineMessages({
mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
});
return (dispatch, getState) => {
dispatch(deleteStatusRequest(id));
- api(getState).delete(`/api/v1/statuses/${id}`).then(response => {
+ api(getState).delete(`/api/v1/statuses/${id}`).then(() => {
dispatch(deleteStatusSuccess(id));
dispatch(deleteFromTimelines(id));
}).catch(error => {
return (dispatch, getState) => {
dispatch(muteStatusRequest(id));
- api(getState).post(`/api/v1/statuses/${id}/mute`).then(response => {
+ api(getState).post(`/api/v1/statuses/${id}/mute`).then(() => {
dispatch(muteStatusSuccess(id));
}).catch(error => {
dispatch(muteStatusFail(id, error));
return (dispatch, getState) => {
dispatch(unmuteStatusRequest(id));
- api(getState).post(`/api/v1/statuses/${id}/unmute`).then(response => {
+ api(getState).post(`/api/v1/statuses/${id}/unmute`).then(() => {
dispatch(unmuteStatusSuccess(id));
}).catch(error => {
dispatch(unmuteStatusFail(id, error));
return <li key={`sep-${i}`} className='dropdown__sep' />;
}
- const { text, action, href = '#' } = item;
+ const { text, href = '#' } = item;
return (
<li className='dropdown__content-list-item' key={`${text}-${i}`}>
visible: !this.props.sensitive,
};
- handleOpen = (e) => {
+ handleOpen = () => {
this.setState({ visible: !this.state.visible });
}
import DisplayName from './display_name';
import MediaGallery from './media_gallery';
import VideoPlayer from './video_player';
-import AttachmentList from './attachment_list';
import StatusContent from './status_content';
import StatusActionBar from './status_action_bar';
import { FormattedMessage } from 'react-intl';
for (var i = 0; i < links.length; ++i) {
let link = links[i];
let mention = this.props.status.get('mentions').find(item => link.href === item.get('url'));
- let media = this.props.status.get('media_attachments').find(item => link.href === item.get('text_url') || (item.get('remote_url').length > 0 && link.href === item.get('remote_url')));
if (mention) {
link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
}
render () {
- const { statusIds, onScrollToBottom, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props;
+ const { statusIds, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props;
let loadMore = null;
let scrollableArea = null;
import PropTypes from 'prop-types';
import configureStore from '../store/configureStore';
import {
- refreshTimelineSuccess,
updateTimeline,
deleteFromTimelines,
refreshHomeTimeline,
import { muteStatus, unmuteStatus, deleteStatus } from '../actions/statuses';
import { initReport } from '../actions/reports';
import { openModal } from '../actions/modal';
-import { createSelector } from 'reselect';
-import { isMobile } from '../is_mobile';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
const messages = defineMessages({
});
const makeMapStateToProps = () => {
- const mapStateToProps = (state, props) => ({
+ const mapStateToProps = state => ({
autoPlayGif: state.getIn(['meta', 'auto_play_gif']),
});
import LoadingIndicator from '../../components/loading_indicator';
import Column from '../ui/components/column';
import ColumnBackButton from '../../components/column_back_button';
-import Immutable from 'immutable';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { getAccountGallery } from '../../selectors';
import MediaItem from './components/media_item';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
-import SettingToggle from '../../notifications/components/setting_toggle';
import SettingText from '../../../components/setting_text';
const messages = defineMessages({
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
onChange: PropTypes.func.isRequired,
- onSave: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
render () {
- const { settings, onChange, onSave, intl } = this.props;
+ const { settings, onChange, intl } = this.props;
return (
<div>
import { connect } from 'react-redux';
import ColumnSettings from '../components/column_settings';
-import { changeSetting, saveSettings } from '../../../actions/settings';
+import { changeSetting } from '../../../actions/settings';
const mapStateToProps = state => ({
settings: state.getIn(['settings', 'community']),
dispatch(changeSetting(['community', ...key], checked));
},
- onSave () {
- dispatch(saveSettings());
- },
-
});
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
} from '../../actions/timelines';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import ColumnSettingsContainer from './containers/column_settings_container';
import createStream from '../../stream';
import AutosuggestTextarea from '../../../components/autosuggest_textarea';
import { debounce } from 'lodash';
import UploadButtonContainer from '../containers/upload_button_container';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import Toggle from 'react-toggle';
+import { defineMessages, injectIntl } from 'react-intl';
import Collapsable from '../../../components/collapsable';
import SpoilerButtonContainer from '../containers/spoiler_button_container';
import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
import SensitiveButtonContainer from '../containers/sensitive_button_container';
import EmojiPickerDropdown from './emoji_picker_dropdown';
import UploadFormContainer from '../containers/upload_form_container';
-import TextIconButton from './text_icon_button';
import WarningContainer from '../containers/warning_container';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { length } from 'stringz';
const text = [this.props.spoiler_text, this.props.text].join('');
let publishText = '';
- let reply_to_other = false;
if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
publishText = <span className='compose-form__publish-private'><i className='fa fa-lock' /> {intl.formatMessage(messages.publish)}</span>;
import(/* webpackChunkName: "emojione_picker" */ 'emojione-picker').then(TheEmojiPicker => {
EmojiPicker = TheEmojiPicker.default;
this.setState({ loading: false });
- }).catch(err => {
+ }).catch(() => {
// TODO: show the user an error?
this.setState({ loading: false });
});
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Avatar from '../../../components/avatar';
-import IconButton from '../../../components/icon_button';
-import DisplayName from '../../../components/display_name';
import Permalink from '../../../components/permalink';
import { FormattedMessage } from 'react-intl';
-import Link from 'react-router-dom/Link';
import ImmutablePureComponent from 'react-immutable-pure-component';
class NavigationBar extends ImmutablePureComponent {
}
render () {
- const { value, onChange, intl } = this.props;
+ const { value, intl } = this.props;
const { open } = this.state;
const options = [
import React from 'react';
import PropTypes from 'prop-types';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
const messages = defineMessages({
placeholder: { id: 'search.placeholder', defaultMessage: 'Search' },
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../../containers/account_container';
import StatusContainer from '../../../containers/status_container';
import Link from 'react-router-dom/Link';
});
const makeMapStateToProps = () => {
- const mapStateToProps = (state, props) => ({
+ const mapStateToProps = state => ({
acceptContentTypes: state.getIn(['media_attachments', 'accept_content_types']),
});
import { connect } from 'react-redux';
import NavigationBar from '../components/navigation_bar';
-const mapStateToProps = (state, props) => {
+const mapStateToProps = state => {
return {
account: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
};
const makeMapStateToProps = () => {
const getStatus = makeGetStatus();
- const mapStateToProps = (state, props) => ({
+ const mapStateToProps = state => ({
status: getStatus(state, state.getIn(['compose', 'in_reply_to'])),
});
import UploadForm from '../components/upload_form';
import { undoUploadCompose } from '../../../actions/compose';
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
media: state.getIn(['compose', 'media_attachments']),
});
import { connect } from 'react-redux';
import UploadProgress from '../components/upload_progress';
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
active: state.getIn(['compose', 'is_uploading']),
progress: state.getIn(['compose', 'progress']),
});
import React from 'react';
import ComposeFormContainer from './containers/compose_form_container';
-import UploadFormContainer from './containers/upload_form_container';
import NavigationContainer from './containers/navigation_container';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
-import ImmutablePropTypes from 'react-immutable-proptypes';
import LoadingIndicator from '../../components/loading_indicator';
import { fetchFavouritedStatuses, expandFavouritedStatuses } from '../../actions/favourites';
import Column from '../ui/components/column';
});
const mapStateToProps = state => ({
- statusIds: state.getIn(['status_lists', 'favourites', 'items']),
loaded: state.getIn(['status_lists', 'favourites', 'loaded']),
- me: state.getIn(['meta', 'me']),
});
class Favourites extends ImmutablePureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
- statusIds: ImmutablePropTypes.list.isRequired,
loaded: PropTypes.bool,
intl: PropTypes.object.isRequired,
- me: PropTypes.number.isRequired,
};
componentWillMount () {
}
render () {
- const { statusIds, loaded, intl, me } = this.props;
+ const { loaded, intl } = this.props;
if (!loaded) {
return (
};
const mapDispatchToProps = (dispatch, { id }) => ({
- onAuthorize (account) {
+ onAuthorize () {
dispatch(authorizeFollowRequest(id));
},
- onReject (account) {
+ onReject () {
dispatch(rejectFollowRequest(id));
},
});
import Column from '../ui/components/column';
import ColumnLink from '../ui/components/column_link';
import ColumnSubheading from '../ui/components/column_subheading';
-import Link from 'react-router-dom/Link';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
deleteFromTimelines,
} from '../../actions/timelines';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import { FormattedMessage } from 'react-intl';
import createStream from '../../stream';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
import SettingToggle from '../../notifications/components/setting_toggle';
import SettingText from '../../../components/setting_text';
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
onChange: PropTypes.func.isRequired,
- onSave: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
render () {
- const { settings, onChange, onSave, intl } = this.props;
+ const { settings, onChange, intl } = this.props;
return (
<div>
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
import ClearColumnButton from './clear_column_button';
import SettingToggle from './setting_toggle';
};
render () {
- const { settings, onChange, onSave, onClear } = this.props;
+ const { settings, onChange, onClear } = this.props;
const alertStr = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
const showStr = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusContainer from '../../../containers/status_container';
import AccountContainer from '../../../containers/account_container';
-import Avatar from '../../../components/avatar';
import { FormattedMessage } from 'react-intl';
import Permalink from '../../../components/permalink';
import emojify from '../../../emoji';
}
render () {
- const { prefix, settings, settingKey, label, onChange } = this.props;
+ const { prefix, settings, settingKey, label } = this.props;
const id = ['setting-toggle', prefix, ...settingKey].filter(Boolean).join('-');
return (
import { connect } from 'react-redux';
import ColumnSettings from '../../community_timeline/components/column_settings';
-import { changeSetting, saveSettings } from '../../../actions/settings';
+import { changeSetting } from '../../../actions/settings';
const mapStateToProps = state => ({
settings: state.getIn(['settings', 'public']),
dispatch(changeSetting(['public', ...key], checked));
},
- onSave () {
- dispatch(saveSettings());
- },
-
});
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
} from '../../actions/timelines';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import ColumnSettingsContainer from './containers/column_settings_container';
import createStream from '../../stream';
import React from 'react';
import { connect } from 'react-redux';
-import { cancelReport, changeReportComment, submitReport } from '../../actions/reports';
+import { changeReportComment, submitReport } from '../../actions/reports';
import { refreshAccountTimeline } from '../../actions/timelines';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { fetchStatus } from '../../actions/statuses';
-import Immutable from 'immutable';
-import EmbeddedStatus from '../../components/status';
import MissingIndicator from '../../components/missing_indicator';
import DetailedStatus from './components/detailed_status';
import ActionBar from './components/action_bar';
} from '../../actions/compose';
import { deleteStatus } from '../../actions/statuses';
import { initReport } from '../../actions/reports';
-import {
- makeGetStatus,
- getStatusAncestors,
- getStatusDescendants,
-} from '../../selectors';
+import { makeGetStatus } from '../../selectors';
import { ScrollContainer } from 'react-router-scroll';
import ColumnBackButton from '../../components/column_back_button';
import StatusContainer from '../../containers/status_container';
import { openModal } from '../../actions/modal';
-import { isMobile } from '../../is_mobile';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
const messages = defineMessages({
);
}
- const account = status.get('account');
-
if (ancestorsIds && ancestorsIds.size > 0) {
ancestors = <div>{this.renderChildren(ancestorsIds)}</div>;
}
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import IconButton from '../../../components/icon_button';
import Button from '../../../components/button';
import StatusContent from '../../../components/status_content';
import Avatar from '../../../components/avatar';
}
render () {
- const { status, intl, onClose } = this.props;
+ const { status, intl } = this.props;
return (
<div className='modal-root__modal boost-modal'>
import React from 'react';
import PropTypes from 'prop-types';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { injectIntl, FormattedMessage } from 'react-intl';
import Button from '../../../components/button';
class ConfirmationModal extends React.PureComponent {
render() {
const { alt, src, previewSrc, width, height } = this.props;
- const { loading, error } = this.state;
+ const { loading } = this.state;
return (
<div className='image-loader'>
import React from 'react';
-import LoadingIndicator from '../../../components/loading_indicator';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ExtendedVideoPlayer from '../../../components/extended_video_player';
me: ImmutablePropTypes.map.isRequired,
};
-const PageThree = ({ me, domain }) => (
+const PageThree = ({ me }) => (
<div className='onboarding-modal__page onboarding-modal__page-three'>
<div className='figure non-interactive'>
<Search
PageThree.propTypes = {
me: ImmutablePropTypes.map.isRequired,
- domain: PropTypes.string.isRequired,
};
const PageFour = ({ domain, intl }) => (
this.pages = [
<PageOne acct={me.get('acct')} domain={domain} />,
<PageTwo me={me} />,
- <PageThree me={me} domain={domain} />,
+ <PageThree me={me} />,
<PageFour domain={domain} intl={intl} />,
<PageSix admin={admin} domain={domain} />,
];
import React from 'react';
-import LoadingIndicator from '../../../components/loading_indicator';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ExtendedVideoPlayer from '../../../components/extended_video_player';
import { connect } from 'react-redux';
import { NotificationStack } from 'react-notification';
-import {
- dismissAlert,
- clearAlerts,
-} from '../../../actions/alerts';
+import { dismissAlert } from '../../../actions/alerts';
import { getAlerts } from '../../../selectors';
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
notifications: getAlerts(state),
});
}
-const noOp = () => false;
-
-
class UI extends React.PureComponent {
static propTypes = {
import { showAlert } from '../actions/alerts';
-const defaultSuccessSuffix = 'SUCCESS';
const defaultFailSuffix = 'FAIL';
export default function errorsMiddleware() {
return ({ dispatch }) => next => action => {
if (action.type && !action.skipAlert) {
const isFail = new RegExp(`${defaultFailSuffix}$`, 'g');
- const isSuccess = new RegExp(`${defaultSuccessSuffix}$`, 'g');
if (action.type.match(isFail)) {
if (action.error.response) {
]),
};
- return ({ dispatch }) => next => (action) => {
+ return () => next => action => {
if (action.meta && action.meta.sound && soundCache[action.meta.sound]) {
play(soundCache[action.meta.sound]);
}
COMPOSE_SPOILERNESS_CHANGE,
COMPOSE_SPOILER_TEXT_CHANGE,
COMPOSE_VISIBILITY_CHANGE,
- COMPOSE_LISTABILITY_CHANGE,
COMPOSE_EMOJI_INSERT,
} from '../actions/compose';
import { TIMELINE_DELETE } from '../actions/timelines';
import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
-import Immutable from 'immutable';
const initialState = {
modalType: null,
results: Immutable.Map(),
});
-const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
- let newSuggestions = [];
-
- if (accounts.length > 0) {
- newSuggestions.push({
- title: 'account',
- items: accounts.map(item => ({
- type: 'account',
- id: item.id,
- value: item.acct,
- })),
- });
- }
-
- if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 || hashtags.length > 0) {
- let hashtagItems = hashtags.map(item => ({
- type: 'hashtag',
- id: item,
- value: `#${item}`,
- }));
-
- if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && !value.startsWith('http://') && !value.startsWith('https://') && hashtags.indexOf(value) === -1) {
- hashtagItems.unshift({
- type: 'hashtag',
- id: value,
- value: `#${value}`,
- });
- }
-
- if (hashtagItems.length > 0) {
- newSuggestions.push({
- title: 'hashtag',
- items: hashtagItems,
- });
- }
- }
-
- if (statuses.length > 0) {
- newSuggestions.push({
- title: 'status',
- items: statuses.map(item => ({
- type: 'status',
- id: item.id,
- value: item.id,
- })),
- });
- }
-
- return state.withMutations(map => {
- map.set('suggestions', newSuggestions);
- map.set('loaded_value', value);
- });
-};
-
export default function search(state = initialState, action) {
switch(action.type) {
case SEARCH_CHANGE:
TIMELINE_CONNECT,
TIMELINE_DISCONNECT,
} from '../actions/timelines';
-import {
- REBLOG_SUCCESS,
- UNREBLOG_SUCCESS,
- FAVOURITE_SUCCESS,
- UNFAVOURITE_SUCCESS,
-} from '../actions/interactions';
import {
ACCOUNT_BLOCK_SUCCESS,
ACCOUNT_MUTE_SUCCESS,
import { createSelector } from 'reselect';
import Immutable from 'immutable';
-const getStatuses = state => state.get('statuses');
-const getAccounts = state => state.get('accounts');
-
const getAccountBase = (state, id) => state.getIn(['accounts', id], null);
const getAccountCounters = (state, id) => state.getIn(['accounts_counters', id], null);
const getAccountRelationship = (state, id) => state.getIn(['relationships', id], null);
import loadingBarMiddleware from '../middleware/loading_bar';
import errorsMiddleware from '../middleware/errors';
import soundsMiddleware from '../middleware/sounds';
-import Immutable from 'immutable';
export default function configureStore() {
return createStore(appReducer, compose(applyMiddleware(
--- /dev/null
+---
+env:
+ mocha: true
+++ /dev/null
-import { expect } from 'chai';
-import { shallow } from 'enzyme';
-import React from 'react';
-import LoadingIndicator from '../../../app/javascript/mastodon/components/loading_indicator';
-
-describe('<LoadingIndicator />', () => {
-
-});
import { configure } from '@storybook/react';
-import React from 'react';
import { addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import '../app/javascript/styles/application.scss';
import React from 'react';
import { storiesOf } from '@storybook/react';
-import { action } from '@storybook/addon-actions';
import CharacterCounter from 'mastodon/features/compose/components/character_counter';
storiesOf('CharacterCounter', module)
import React from 'react';
import { IntlProvider } from 'react-intl';
import { storiesOf } from '@storybook/react';
-import { action } from '@storybook/addon-actions';
import en from 'mastodon/locales/en.json';
import LoadingIndicator from 'mastodon/components/loading_indicator';
accountFromRequest(req, next);
};
- const errorMiddleware = (err, req, res, next) => {
+ const errorMiddleware = (err, req, res) => {
log.error(req.requestId, err.toString());
res.writeHead(err.statusCode || 500, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ error: err.statusCode ? err.toString() : 'An unexpected error occurred' }));
}
});
- ws.on('error', e => {
+ ws.on('error', () => {
log.verbose(req.requestId, `Ending stream for ${req.accountId}`);
unsubscribe(id, listener);
if (closeHandler) {
}
});
- const wsInterval = setInterval(() => {
+ setInterval(() => {
wss.clients.forEach(ws => {
if (ws.isAlive === false) {
ws.terminate();