eslint: trailing comma fixes, unused var

patch-2
Alex Gleason 2020-10-07 13:08:36 -05:00
rodzic ed9988b350
commit 0bbdaa4191
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
52 zmienionych plików z 76 dodań i 93 usunięć

Wyświetl plik

@ -111,7 +111,7 @@ export function fetchAccount(id) {
dispatch, dispatch,
getState, getState,
db.transaction('accounts', 'read').objectStore('accounts').index('id'), db.transaction('accounts', 'read').objectStore('accounts').index('id'),
id id,
).then(() => db.close(), error => { ).then(() => db.close(), error => {
db.close(); db.close();
throw error; throw error;

Wyświetl plik

@ -29,7 +29,7 @@ export const simpleEmojiReact = (status, emoji) => {
emojiReacts emojiReacts
.filter(emojiReact => emojiReact.get('me') === true) .filter(emojiReact => emojiReact.get('me') === true)
.map(emojiReact => dispatch(unEmojiReact(status, emojiReact.get('name')))), .map(emojiReact => dispatch(unEmojiReact(status, emojiReact.get('name')))),
status.get('favourited') && dispatch(unfavourite(status)) status.get('favourited') && dispatch(unfavourite(status)),
).then(() => { ).then(() => {
if (emoji === '👍') { if (emoji === '👍') {
dispatch(favourite(status)); dispatch(favourite(status));

Wyświetl plik

@ -15,7 +15,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={0} count={0}
message={messages.queue} message={messages.queue}
/> />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
expect(createComponent( expect(createComponent(
@ -24,7 +24,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={1} count={1}
message={messages.queue} message={messages.queue}
/> />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
expect(createComponent( expect(createComponent(
@ -33,7 +33,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={9999999} count={9999999}
message={messages.queue} message={messages.queue}
/> />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });

Wyświetl plik

@ -130,7 +130,7 @@ class ColumnHeader extends React.PureComponent {
} }
> >
{list.get('title')} {list.get('title')}
</Link>) </Link>),
); );
} }

Wyświetl plik

@ -44,7 +44,7 @@ export default class IntersectionObserverArticle extends React.Component {
intersectionObserverWrapper.observe( intersectionObserverWrapper.observe(
id, id,
this.node, this.node,
this.handleIntersection this.handleIntersection,
); );
this.componentMounted = true; this.componentMounted = true;

Wyświetl plik

@ -323,7 +323,7 @@ class MediaGallery extends React.PureComponent {
let itemsDimensions = []; let itemsDimensions = [];
const ratios = Array(size).fill().map((_, i) => const ratios = Array(size).fill().map((_, i) =>
media.getIn([i, 'meta', 'small', 'aspect']) media.getIn([i, 'meta', 'small', 'aspect']),
); );
const [ar1, ar2, ar3, ar4] = ratios; const [ar1, ar2, ar3, ar4] = ratios;

Wyświetl plik

@ -406,5 +406,5 @@ const mapDispatchToProps = (dispatch) => ({
}); });
export default injectIntl( export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true } connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
)(StatusActionBar)); )(StatusActionBar));

Wyświetl plik

@ -7,7 +7,7 @@ import { Map as ImmutableMap } from 'immutable';
describe('<CaptchaField />', () => { describe('<CaptchaField />', () => {
it('renders null by default', () => { it('renders null by default', () => {
expect(createComponent( expect(createComponent(
<CaptchaField /> <CaptchaField />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -25,7 +25,7 @@ describe('<NativeCaptchaField />', () => {
<NativeCaptchaField <NativeCaptchaField
captcha={captcha} captcha={captcha}
onChange={() => {}} // eslint-disable-line react/jsx-no-bind onChange={() => {}} // eslint-disable-line react/jsx-no-bind
/> />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });

Wyświetl plik

@ -5,7 +5,7 @@ import { createComponent } from 'soapbox/test_helpers';
describe('<LoginForm />', () => { describe('<LoginForm />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(createComponent( expect(createComponent(
<LoginForm /> <LoginForm />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });

Wyświetl plik

@ -13,13 +13,13 @@ describe('<LoginPage />', () => {
it('renders correctly on load', () => { it('renders correctly on load', () => {
expect(createComponent( expect(createComponent(
<LoginPage /> <LoginPage />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
const store = mockStore(ImmutableMap({ me: '1234' })); const store = mockStore(ImmutableMap({ me: '1234' }));
expect(createComponent( expect(createComponent(
<LoginPage />, <LoginPage />,
{ store } { store },
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });

Wyświetl plik

@ -12,7 +12,7 @@ describe('<OtpAuthForm />', () => {
<OtpAuthForm <OtpAuthForm
mfa_token={'12345'} mfa_token={'12345'}
/>, />,
{ store } { store },
).toJSON(); ).toJSON();
expect(wrapper).toEqual(expect.objectContaining({ expect(wrapper).toEqual(expect.objectContaining({

Wyświetl plik

@ -28,7 +28,7 @@ class LoginPage extends ImmutablePureComponent {
getFormData = (form) => { getFormData = (form) => {
return Object.fromEntries( return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value]) Array.from(form).map(i => [i.name, i.value]),
); );
} }

Wyświetl plik

@ -29,7 +29,7 @@ class OtpAuthForm extends ImmutablePureComponent {
getFormData = (form) => { getFormData = (form) => {
return Object.fromEntries( return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value]) Array.from(form).map(i => [i.name, i.value]),
); );
} }

Wyświetl plik

@ -62,7 +62,7 @@ class Blocks extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} /> <AccountContainer key={id} id={id} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -87,7 +87,7 @@ class ChatMessageList extends ImmutablePureComponent {
day: '2-digit', day: '2-digit',
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
} },
); );
}; };

Wyświetl plik

@ -78,7 +78,7 @@ class ChatPanes extends ImmutablePureComponent {
<div className='chat-panes'> <div className='chat-panes'>
{mainWindowPane} {mainWindowPane}
{panes.map((pane, i) => {panes.map((pane, i) =>
<ChatWindow idx={i} pane={pane} key={pane.get('chat_id')} /> <ChatWindow idx={i} pane={pane} key={pane.get('chat_id')} />,
)} )}
</div> </div>
); );

Wyświetl plik

@ -63,7 +63,7 @@ class Blocks extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{domains.map(domain => {domains.map(domain =>
<DomainContainer key={domain} domain={domain} /> <DomainContainer key={domain} domain={domain} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -40,7 +40,7 @@ const mapStateToProps = state => {
// Forces fields to be maxFields size, filling empty values // Forces fields to be maxFields size, filling empty values
const normalizeFields = (fields, maxFields) => ( const normalizeFields = (fields, maxFields) => (
ImmutableList(fields).setSize(maxFields).map(field => ImmutableList(fields).setSize(maxFields).map(field =>
field ? field : ImmutableMap({ name: '', value: '' }) field ? field : ImmutableMap({ name: '', value: '' }),
) )
); );
@ -91,7 +91,7 @@ class EditProfile extends ImmutablePureComponent {
this.state.fields.forEach((f, i) => this.state.fields.forEach((f, i) =>
params = params params = params
.set(`fields_attributes[${i}][name]`, f.get('name')) .set(`fields_attributes[${i}][name]`, f.get('name'))
.set(`fields_attributes[${i}][value]`, f.get('value')) .set(`fields_attributes[${i}][value]`, f.get('value')),
); );
return params; return params;
} }

Wyświetl plik

@ -56,7 +56,7 @@ class Favourites extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} /> <AccountContainer key={id} id={id} withNote={false} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -62,7 +62,7 @@ class FollowRequests extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountAuthorizeContainer key={id} id={id} /> <AccountAuthorizeContainer key={id} id={id} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -122,7 +122,7 @@ class Followers extends ImmutablePureComponent {
emptyMessage={<FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />} emptyMessage={<FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} /> <AccountContainer key={id} id={id} withNote={false} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -122,7 +122,7 @@ class Following extends ImmutablePureComponent {
emptyMessage={<FormattedMessage id='account.follows.empty' defaultMessage="This user doesn't follow anyone yet." />} emptyMessage={<FormattedMessage id='account.follows.empty' defaultMessage="This user doesn't follow anyone yet." />}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} /> <AccountContainer key={id} id={id} withNote={false} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -15,7 +15,7 @@ import {
describe('<InputContainer />', () => { describe('<InputContainer />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<InputContainer /> <InputContainer />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -23,7 +23,7 @@ describe('<InputContainer />', () => {
describe('<SimpleInput />', () => { describe('<SimpleInput />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<SimpleInput /> <SimpleInput />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -31,7 +31,7 @@ describe('<SimpleInput />', () => {
describe('<SimpleForm />', () => { describe('<SimpleForm />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<SimpleForm /> <SimpleForm />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -39,7 +39,7 @@ describe('<SimpleForm />', () => {
describe('<FieldsGroup />', () => { describe('<FieldsGroup />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<FieldsGroup /> <FieldsGroup />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -47,7 +47,7 @@ describe('<FieldsGroup />', () => {
describe('<Checkbox />', () => { describe('<Checkbox />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<Checkbox /> <Checkbox />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -55,7 +55,7 @@ describe('<Checkbox />', () => {
describe('<RadioGroup />', () => { describe('<RadioGroup />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<RadioGroup /> <RadioGroup />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -63,7 +63,7 @@ describe('<RadioGroup />', () => {
describe('<SelectDropdown />', () => { describe('<SelectDropdown />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<SelectDropdown items={{ one: 'One', two: 'Two', three: 'Three' }} /> <SelectDropdown items={{ one: 'One', two: 'Two', three: 'Three' }} />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -71,7 +71,7 @@ describe('<SelectDropdown />', () => {
describe('<TextInput />', () => { describe('<TextInput />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<TextInput /> <TextInput />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });
@ -79,7 +79,7 @@ describe('<TextInput />', () => {
describe('<FileChooser />', () => { describe('<FileChooser />', () => {
it('renders correctly', () => { it('renders correctly', () => {
expect(renderer.create( expect(renderer.create(
<FileChooser /> <FileChooser />,
).toJSON()).toMatchSnapshot(); ).toJSON()).toMatchSnapshot();
}); });
}); });

Wyświetl plik

@ -171,7 +171,7 @@ export class RadioGroup extends ImmutablePureComponent {
const { label, children, onChange } = this.props; const { label, children, onChange } = this.props;
const childrenWithProps = React.Children.map(children, child => const childrenWithProps = React.Children.map(children, child =>
React.cloneElement(child, { onChange }) React.cloneElement(child, { onChange }),
); );
return ( return (

Wyświetl plik

@ -102,7 +102,7 @@ class GettingStarted extends ImmutablePureComponent {
height += 34 + 48*2; height += 34 + 48*2;
navItems.push( navItems.push(
<ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} /> <ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} />,
); );
height += 34; height += 34;
@ -111,7 +111,7 @@ class GettingStarted extends ImmutablePureComponent {
navItems.push( navItems.push(
<ColumnLink key={i++} icon='envelope' text={intl.formatMessage(messages.direct)} to='/timelines/direct' />, <ColumnLink key={i++} icon='envelope' text={intl.formatMessage(messages.direct)} to='/timelines/direct' />,
<ColumnLink key={i++} icon='star' text={intl.formatMessage(messages.favourites)} to='/favorites' />, <ColumnLink key={i++} icon='star' text={intl.formatMessage(messages.favourites)} to='/favorites' />,
<ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' /> <ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />,
); );
height += 48*3; height += 48*3;

Wyświetl plik

@ -71,7 +71,7 @@ class Lists extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{lists.map(list => {lists.map(list =>
<ColumnLink key={list.get('id')} to={`/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} /> <ColumnLink key={list.get('id')} to={`/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -62,7 +62,7 @@ class Mutes extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} /> <AccountContainer key={id} id={id} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -44,7 +44,7 @@ class Header extends ImmutablePureComponent {
getFormData = (form) => { getFormData = (form) => {
return Object.fromEntries( return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value]) Array.from(form).map(i => [i.name, i.value]),
); );
} }

Wyświetl plik

@ -77,7 +77,7 @@ class Reblogs extends ImmutablePureComponent {
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} /> <AccountContainer key={id} id={id} withNote={false} />,
)} )}
</ScrollableList> </ScrollableList>
</Column> </Column>

Wyświetl plik

@ -140,19 +140,19 @@ class SoapboxConfig extends ImmutablePureComponent {
path, (e) => path, (e) =>
template template
.merge(field) .merge(field)
.set(key, e.target.value) .set(key, e.target.value),
); );
}; };
handlePromoItemChange = (index, key, field) => { handlePromoItemChange = (index, key, field) => {
return this.handleItemChange( return this.handleItemChange(
['promoPanel', 'items', index], key, field, templates.promoPanelItem ['promoPanel', 'items', index], key, field, templates.promoPanelItem,
); );
}; };
handleHomeFooterItemChange = (index, key, field) => { handleHomeFooterItemChange = (index, key, field) => {
return this.handleItemChange( return this.handleItemChange(
['navlinks', 'homeFooter', index], key, field, templates.footerItem ['navlinks', 'homeFooter', index], key, field, templates.footerItem,
); );
}; };

Wyświetl plik

@ -98,7 +98,7 @@ export default class Card extends React.PureComponent {
}, },
}, },
]), ]),
0 0,
); );
}; };

Wyświetl plik

@ -71,5 +71,5 @@ const mapStateToProps = state => {
export default injectIntl( export default injectIntl(
connect(mapStateToProps, null, null, { connect(mapStateToProps, null, null, {
forwardRef: true, forwardRef: true,
} },
)(FundingPanel)); )(FundingPanel));

Wyświetl plik

@ -150,5 +150,5 @@ const mapStateToProps = (state, { account }) => {
export default injectIntl( export default injectIntl(
connect(mapStateToProps, null, null, { connect(mapStateToProps, null, null, {
forwardRef: true, forwardRef: true,
} },
)(ProfileInfoPanel)); )(ProfileInfoPanel));

Wyświetl plik

@ -81,5 +81,5 @@ const mapStateToProps = (state, { account }) => ({
export default injectIntl( export default injectIntl(
connect(mapStateToProps, null, null, { connect(mapStateToProps, null, null, {
forwardRef: true, forwardRef: true,
} },
)(ProfileMediaPanel)); )(ProfileMediaPanel));

Wyświetl plik

@ -28,7 +28,7 @@ class PromoPanel extends React.PureComponent {
<Icon id={item.get('icon')} className='promo-panel-item__icon' fixedWidth /> <Icon id={item.get('icon')} className='promo-panel-item__icon' fixedWidth />
{item.get('text')} {item.get('text')}
</a> </a>
</div>) </div>),
)} )}
</div> </div>
</div> </div>

Wyświetl plik

@ -94,7 +94,7 @@ class TabsBar extends React.PureComponent {
<NavLink key='search' className='tabs-bar__link tabs-bar__link--search' to='/search' data-preview-title-id='tabs_bar.search'> <NavLink key='search' className='tabs-bar__link tabs-bar__link--search' to='/search' data-preview-title-id='tabs_bar.search'>
<Icon id='search' /> <Icon id='search' />
<span><FormattedMessage id='tabs_bar.search' defaultMessage='Search' /></span> <span><FormattedMessage id='tabs_bar.search' defaultMessage='Search' /></span>
</NavLink> </NavLink>,
); );
return links.map((link) => return links.map((link) =>
React.cloneElement(link, { React.cloneElement(link, {
@ -172,5 +172,5 @@ const mapDispatchToProps = (dispatch) => ({
}); });
export default injectIntl( export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true } connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
)(TabsBar)); )(TabsBar));

Wyświetl plik

@ -66,5 +66,5 @@ const mapDispatchToProps = dispatch => {
export default injectIntl( export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true, forwardRef: true,
} },
)(TrendsPanel)); )(TrendsPanel));

Wyświetl plik

@ -74,5 +74,5 @@ const mapDispatchToProps = dispatch => {
export default injectIntl( export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true, forwardRef: true,
} },
)(WhoToFollowPanel)); )(WhoToFollowPanel));

Wyświetl plik

@ -8,7 +8,7 @@ const defaultBarStyleFactory = (index, style, notification) => {
return Object.assign( return Object.assign(
{}, {},
style, style,
{ bottom: `${14 + index * 12 + index * 42}px` } { bottom: `${14 + index * 12 + index * 42}px` },
); );
}; };

Wyświetl plik

@ -109,7 +109,7 @@ const logOut = (state = ImmutableMap()) => {
whitelist.reduce((acc, curr) => { whitelist.reduce((acc, curr) => {
acc[curr] = state.get(curr); acc[curr] = state.get(curr);
return acc; return acc;
}, {}) }, {}),
); );
}; };

Wyświetl plik

@ -70,7 +70,7 @@ const processRawNotifications = notifications => (
ImmutableOrderedMap( ImmutableOrderedMap(
notifications notifications
.filter(isValid) .filter(isValid)
.map(n => [n.id, notificationToMap(n)]) .map(n => [n.id, notificationToMap(n)]),
)); ));
const expandNormalizedNotifications = (state, notifications, next) => { const expandNormalizedNotifications = (state, notifications, next) => {

Wyświetl plik

@ -55,13 +55,13 @@ export default function statuses(state = initialState, action) {
return state return state
.updateIn( .updateIn(
[action.status.get('id'), 'pleroma', 'emoji_reactions'], [action.status.get('id'), 'pleroma', 'emoji_reactions'],
emojiReacts => simulateEmojiReact(emojiReacts, action.emoji) emojiReacts => simulateEmojiReact(emojiReacts, action.emoji),
); );
case UNEMOJI_REACT_REQUEST: case UNEMOJI_REACT_REQUEST:
return state return state
.updateIn( .updateIn(
[action.status.get('id'), 'pleroma', 'emoji_reactions'], [action.status.get('id'), 'pleroma', 'emoji_reactions'],
emojiReacts => simulateUnEmojiReact(emojiReacts, action.emoji) emojiReacts => simulateUnEmojiReact(emojiReacts, action.emoji),
); );
case FAVOURITE_FAIL: case FAVOURITE_FAIL:
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false); return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false);

Wyświetl plik

@ -58,7 +58,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
return oldIds.take(firstIndex + 1).concat( return oldIds.take(firstIndex + 1).concat(
isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds, isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
oldIds.skip(lastIndex) oldIds.skip(lastIndex),
); );
}); });
} }
@ -149,7 +149,7 @@ const updateTop = (state, timeline, top) => {
const filterTimeline = (timeline, state, relationship, statuses) => const filterTimeline = (timeline, state, relationship, statuses) =>
state.updateIn([timeline, 'items'], ImmutableList(), list => state.updateIn([timeline, 'items'], ImmutableList(), list =>
list.filterNot(statusId => list.filterNot(statusId =>
statuses.getIn([statusId, 'account']) === relationship.id statuses.getIn([statusId, 'account']) === relationship.id,
)); ));
const removeStatusFromGroup = (state, groupId, statusId) => { const removeStatusFromGroup = (state, groupId, statusId) => {
@ -190,7 +190,7 @@ export default function timelines(state = initialState, action) {
return state.update( return state.update(
action.timeline, action.timeline,
initialTimeline, initialTimeline,
map => map.set('online', false).update('items', items => items.first() ? items.unshift(null) : items) map => map.set('online', false).update('items', items => items.first() ? items.unshift(null) : items),
); );
case GROUP_REMOVE_STATUS_SUCCESS: case GROUP_REMOVE_STATUS_SUCCESS:
return removeStatusFromGroup(state, action.groupId, action.id); return removeStatusFromGroup(state, action.groupId, action.id);

Wyświetl plik

@ -110,7 +110,7 @@ export const makeGetStatus = () => {
map.set('account', accountBase); map.set('account', accountBase);
map.set('filtered', filtered); map.set('filtered', filtered);
}); });
} },
); );
}; };
@ -172,6 +172,6 @@ export const makeGetChat = () => {
map.set('account', account); map.set('account', account);
map.set('last_message', lastMessage); map.set('last_message', lastMessage);
}); });
} },
); );
}; };

Wyświetl plik

@ -118,7 +118,7 @@ const handlePush = (event) => {
badge: '/badge.png', badge: '/badge.png',
data: { access_token, preferred_locale, url: '/notifications' }, data: { access_token, preferred_locale, url: '/notifications' },
}); });
}) }),
); );
}; };

Wyświetl plik

@ -10,6 +10,6 @@ export default function configureStore() {
thunk, thunk,
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }), loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
errorsMiddleware(), errorsMiddleware(),
soundsMiddleware() soundsMiddleware(),
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f)); ), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
}; };

Wyświetl plik

@ -28,6 +28,6 @@ export const createComponent = (children, props = {}) => {
{children} {children}
</BrowserRouter> </BrowserRouter>
</IntlProvider> </IntlProvider>
</Provider> </Provider>,
); );
}; };

Wyświetl plik

@ -1,7 +1,7 @@
export const ConfigDB = { export const ConfigDB = {
find: (configs, group, key) => { find: (configs, group, key) => {
return configs.find(config => return configs.find(config =>
config.isSuperset({ group, key }) config.isSuperset({ group, key }),
); );
}, },
}; };

Wyświetl plik

@ -39,8 +39,8 @@ export const mergeEmojiFavourites = (emojiReacts, favouritesCount, favourited) =
const hasMultiReactions = (emojiReacts, account) => ( const hasMultiReactions = (emojiReacts, account) => (
emojiReacts.filter( emojiReacts.filter(
e => e.get('accounts').filter( e => e.get('accounts').filter(
a => a.get('id') === account.get('id') a => a.get('id') === account.get('id'),
).count() > 0 ).count() > 0,
).count() > 1 ).count() > 1
); );
@ -72,14 +72,14 @@ export const filterEmoji = (emojiReacts, allowedEmoji=ALLOWED_EMOJI) => (
export const reduceEmoji = (emojiReacts, favouritesCount, favourited, allowedEmoji=ALLOWED_EMOJI) => ( export const reduceEmoji = (emojiReacts, favouritesCount, favourited, allowedEmoji=ALLOWED_EMOJI) => (
filterEmoji(sortEmoji(mergeEmoji(mergeEmojiFavourites( filterEmoji(sortEmoji(mergeEmoji(mergeEmojiFavourites(
emojiReacts, favouritesCount, favourited emojiReacts, favouritesCount, favourited,
))), allowedEmoji)); ))), allowedEmoji));
export const getReactForStatus = status => { export const getReactForStatus = status => {
return reduceEmoji( return reduceEmoji(
status.getIn(['pleroma', 'emoji_reactions'], ImmutableList()), status.getIn(['pleroma', 'emoji_reactions'], ImmutableList()),
status.get('favourites_count'), status.get('favourites_count'),
status.get('favourited') status.get('favourited'),
).filter(e => e.get('me') === true) ).filter(e => e.get('me') === true)
.getIn([0, 'name']); .getIn([0, 'name']);
}; };

Wyświetl plik

@ -89,7 +89,7 @@ module.exports = merge(sharedConfig, {
watchOptions: Object.assign( watchOptions: Object.assign(
{}, {},
settings.dev_server.watch_options, settings.dev_server.watch_options,
watchOptions watchOptions,
), ),
serveIndex: true, serveIndex: true,
proxy: makeProxyConfig(), proxy: makeProxyConfig(),

Wyświetl plik

@ -1,7 +1,6 @@
// Note: You must restart bin/webpack-dev-server for changes to take effect // Note: You must restart bin/webpack-dev-server for changes to take effect
console.log('Running in production mode'); // eslint-disable-line no-console console.log('Running in production mode'); // eslint-disable-line no-console
const { URL } = require('url');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const OfflinePlugin = require('offline-plugin'); const OfflinePlugin = require('offline-plugin');
@ -10,22 +9,6 @@ const CompressionPlugin = require('compression-webpack-plugin');
const { output } = require('./configuration'); const { output } = require('./configuration');
const sharedConfig = require('./shared'); const sharedConfig = require('./shared');
// eslint-disable-next-line no-unused-vars
let attachmentHost;
if (process.env.S3_ENABLED === 'true') {
if (process.env.S3_ALIAS_HOST || process.env.S3_CLOUDFRONT_HOST) {
attachmentHost = process.env.S3_ALIAS_HOST || process.env.S3_CLOUDFRONT_HOST;
} else {
attachmentHost = process.env.S3_HOSTNAME || `s3-${process.env.S3_REGION || 'us-east-1'}.amazonaws.com`;
}
} else if (process.env.SWIFT_ENABLED === 'true') {
const { host } = new URL(process.env.SWIFT_OBJECT_URL);
attachmentHost = host;
} else {
attachmentHost = null;
}
module.exports = merge(sharedConfig, { module.exports = merge(sharedConfig, {
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: 'source-map',

Wyświetl plik

@ -12,7 +12,7 @@ const rules = require('./rules');
module.exports = { module.exports = {
entry: Object.assign( entry: Object.assign(
{ application: resolve('app/application.js') }, { application: resolve('app/application.js') },
{ styles: resolve(join(settings.source_path, 'styles/application.scss')) } { styles: resolve(join(settings.source_path, 'styles/application.scss')) },
), ),
output: { output: {
@ -54,7 +54,7 @@ module.exports = {
// temporary fix for https://github.com/ReactTraining/react-router/issues/5576 // temporary fix for https://github.com/ReactTraining/react-router/issues/5576
// to reduce bundle size // to reduce bundle size
resource.request = resource.request.replace(/^history/, 'history/es'); resource.request = resource.request.replace(/^history/, 'history/es');
} },
), ),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: 'css/[name]-[contenthash:8].css', filename: 'css/[name]-[contenthash:8].css',