mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Improve eslint rules (#3147)
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
This commit is contained in:
parent
812fe90eca
commit
2e112e2406
@ -47,6 +47,13 @@ rules:
|
||||
no-mixed-spaces-and-tabs: warn
|
||||
no-nested-ternary: warn
|
||||
no-trailing-spaces: warn
|
||||
semi: error
|
||||
padded-blocks:
|
||||
- error
|
||||
- classes: always
|
||||
comma-dangle:
|
||||
- error
|
||||
- always-multiline
|
||||
|
||||
react/jsx-wrap-multilines: error
|
||||
react/jsx-no-bind: error
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
import Immutable from 'immutable';
|
||||
|
||||
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
|
||||
@ -154,8 +154,8 @@ export function expandAccountTimeline(id) {
|
||||
api(getState).get(`/api/v1/accounts/${id}/statuses`, {
|
||||
params: {
|
||||
limit: 10,
|
||||
max_id: lastId
|
||||
}
|
||||
max_id: lastId,
|
||||
},
|
||||
}).then(response => {
|
||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||
dispatch(expandAccountTimelineSuccess(id, response.data, next));
|
||||
@ -175,8 +175,8 @@ export function expandAccountMediaTimeline(id) {
|
||||
params: {
|
||||
limit: 12,
|
||||
only_media: 'true',
|
||||
max_id: lastId
|
||||
}
|
||||
max_id: lastId,
|
||||
},
|
||||
}).then(response => {
|
||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||
dispatch(expandAccountMediaTimelineSuccess(id, response.data, next));
|
||||
@ -189,14 +189,14 @@ export function expandAccountMediaTimeline(id) {
|
||||
export function fetchAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_FETCH_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchAccountSuccess(account) {
|
||||
return {
|
||||
type: ACCOUNT_FETCH_SUCCESS,
|
||||
account
|
||||
account,
|
||||
};
|
||||
};
|
||||
|
||||
@ -205,7 +205,7 @@ export function fetchAccountFail(id, error) {
|
||||
type: ACCOUNT_FETCH_FAIL,
|
||||
id,
|
||||
error,
|
||||
skipAlert: true
|
||||
skipAlert: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -230,48 +230,48 @@ export function unfollowAccount(id) {
|
||||
}).catch(error => {
|
||||
dispatch(unfollowAccountFail(error));
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export function followAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_FOLLOW_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function followAccountSuccess(relationship) {
|
||||
return {
|
||||
type: ACCOUNT_FOLLOW_SUCCESS,
|
||||
relationship
|
||||
relationship,
|
||||
};
|
||||
};
|
||||
|
||||
export function followAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_FOLLOW_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
export function unfollowAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_UNFOLLOW_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function unfollowAccountSuccess(relationship) {
|
||||
return {
|
||||
type: ACCOUNT_UNFOLLOW_SUCCESS,
|
||||
relationship
|
||||
relationship,
|
||||
};
|
||||
};
|
||||
|
||||
export function unfollowAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_UNFOLLOW_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -279,7 +279,7 @@ export function fetchAccountTimelineRequest(id, skipLoading) {
|
||||
return {
|
||||
type: ACCOUNT_TIMELINE_FETCH_REQUEST,
|
||||
id,
|
||||
skipLoading
|
||||
skipLoading,
|
||||
};
|
||||
};
|
||||
|
||||
@ -289,7 +289,7 @@ export function fetchAccountTimelineSuccess(id, statuses, replace, skipLoading)
|
||||
id,
|
||||
statuses,
|
||||
replace,
|
||||
skipLoading
|
||||
skipLoading,
|
||||
};
|
||||
};
|
||||
|
||||
@ -299,7 +299,7 @@ export function fetchAccountTimelineFail(id, error, skipLoading) {
|
||||
id,
|
||||
error,
|
||||
skipLoading,
|
||||
skipAlert: error.response.status === 404
|
||||
skipAlert: error.response.status === 404,
|
||||
};
|
||||
};
|
||||
|
||||
@ -307,7 +307,7 @@ export function fetchAccountMediaTimelineRequest(id, skipLoading) {
|
||||
return {
|
||||
type: ACCOUNT_MEDIA_TIMELINE_FETCH_REQUEST,
|
||||
id,
|
||||
skipLoading
|
||||
skipLoading,
|
||||
};
|
||||
};
|
||||
|
||||
@ -317,7 +317,7 @@ export function fetchAccountMediaTimelineSuccess(id, statuses, replace, skipLoad
|
||||
id,
|
||||
statuses,
|
||||
replace,
|
||||
skipLoading
|
||||
skipLoading,
|
||||
};
|
||||
};
|
||||
|
||||
@ -327,14 +327,14 @@ export function fetchAccountMediaTimelineFail(id, error, skipLoading) {
|
||||
id,
|
||||
error,
|
||||
skipLoading,
|
||||
skipAlert: error.response.status === 404
|
||||
skipAlert: error.response.status === 404,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandAccountTimelineRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_TIMELINE_EXPAND_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -343,7 +343,7 @@ export function expandAccountTimelineSuccess(id, statuses, next) {
|
||||
type: ACCOUNT_TIMELINE_EXPAND_SUCCESS,
|
||||
id,
|
||||
statuses,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -351,14 +351,14 @@ export function expandAccountTimelineFail(id, error) {
|
||||
return {
|
||||
type: ACCOUNT_TIMELINE_EXPAND_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandAccountMediaTimelineRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_MEDIA_TIMELINE_EXPAND_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -367,7 +367,7 @@ export function expandAccountMediaTimelineSuccess(id, statuses, next) {
|
||||
type: ACCOUNT_MEDIA_TIMELINE_EXPAND_SUCCESS,
|
||||
id,
|
||||
statuses,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -375,7 +375,7 @@ export function expandAccountMediaTimelineFail(id, error) {
|
||||
return {
|
||||
type: ACCOUNT_MEDIA_TIMELINE_EXPAND_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -407,7 +407,7 @@ export function unblockAccount(id) {
|
||||
export function blockAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_BLOCK_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -415,35 +415,35 @@ export function blockAccountSuccess(relationship, statuses) {
|
||||
return {
|
||||
type: ACCOUNT_BLOCK_SUCCESS,
|
||||
relationship,
|
||||
statuses
|
||||
statuses,
|
||||
};
|
||||
};
|
||||
|
||||
export function blockAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_BLOCK_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
export function unblockAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_UNBLOCK_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function unblockAccountSuccess(relationship) {
|
||||
return {
|
||||
type: ACCOUNT_UNBLOCK_SUCCESS,
|
||||
relationship
|
||||
relationship,
|
||||
};
|
||||
};
|
||||
|
||||
export function unblockAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_UNBLOCK_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -476,7 +476,7 @@ export function unmuteAccount(id) {
|
||||
export function muteAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_MUTE_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -484,35 +484,35 @@ export function muteAccountSuccess(relationship, statuses) {
|
||||
return {
|
||||
type: ACCOUNT_MUTE_SUCCESS,
|
||||
relationship,
|
||||
statuses
|
||||
statuses,
|
||||
};
|
||||
};
|
||||
|
||||
export function muteAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_MUTE_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
export function unmuteAccountRequest(id) {
|
||||
return {
|
||||
type: ACCOUNT_UNMUTE_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function unmuteAccountSuccess(relationship) {
|
||||
return {
|
||||
type: ACCOUNT_UNMUTE_SUCCESS,
|
||||
relationship
|
||||
relationship,
|
||||
};
|
||||
};
|
||||
|
||||
export function unmuteAccountFail(error) {
|
||||
return {
|
||||
type: ACCOUNT_UNMUTE_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -535,7 +535,7 @@ export function fetchFollowers(id) {
|
||||
export function fetchFollowersRequest(id) {
|
||||
return {
|
||||
type: FOLLOWERS_FETCH_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -544,7 +544,7 @@ export function fetchFollowersSuccess(id, accounts, next) {
|
||||
type: FOLLOWERS_FETCH_SUCCESS,
|
||||
id,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -552,7 +552,7 @@ export function fetchFollowersFail(id, error) {
|
||||
return {
|
||||
type: FOLLOWERS_FETCH_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -580,7 +580,7 @@ export function expandFollowers(id) {
|
||||
export function expandFollowersRequest(id) {
|
||||
return {
|
||||
type: FOLLOWERS_EXPAND_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -589,7 +589,7 @@ export function expandFollowersSuccess(id, accounts, next) {
|
||||
type: FOLLOWERS_EXPAND_SUCCESS,
|
||||
id,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -597,7 +597,7 @@ export function expandFollowersFail(id, error) {
|
||||
return {
|
||||
type: FOLLOWERS_EXPAND_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -619,7 +619,7 @@ export function fetchFollowing(id) {
|
||||
export function fetchFollowingRequest(id) {
|
||||
return {
|
||||
type: FOLLOWING_FETCH_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -628,7 +628,7 @@ export function fetchFollowingSuccess(id, accounts, next) {
|
||||
type: FOLLOWING_FETCH_SUCCESS,
|
||||
id,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -636,7 +636,7 @@ export function fetchFollowingFail(id, error) {
|
||||
return {
|
||||
type: FOLLOWING_FETCH_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -664,7 +664,7 @@ export function expandFollowing(id) {
|
||||
export function expandFollowingRequest(id) {
|
||||
return {
|
||||
type: FOLLOWING_EXPAND_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -673,7 +673,7 @@ export function expandFollowingSuccess(id, accounts, next) {
|
||||
type: FOLLOWING_EXPAND_SUCCESS,
|
||||
id,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
@ -681,7 +681,7 @@ export function expandFollowingFail(id, error) {
|
||||
return {
|
||||
type: FOLLOWING_EXPAND_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -708,7 +708,7 @@ export function fetchRelationshipsRequest(ids) {
|
||||
return {
|
||||
type: RELATIONSHIPS_FETCH_REQUEST,
|
||||
ids,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -716,7 +716,7 @@ export function fetchRelationshipsSuccess(relationships) {
|
||||
return {
|
||||
type: RELATIONSHIPS_FETCH_SUCCESS,
|
||||
relationships,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -724,7 +724,7 @@ export function fetchRelationshipsFail(error) {
|
||||
return {
|
||||
type: RELATIONSHIPS_FETCH_FAIL,
|
||||
error,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -734,14 +734,14 @@ export function fetchFollowRequests() {
|
||||
|
||||
api(getState).get('/api/v1/follow_requests').then(response => {
|
||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||
dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null))
|
||||
dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null));
|
||||
}).catch(error => dispatch(fetchFollowRequestsFail(error)));
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchFollowRequestsRequest() {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_FETCH_REQUEST
|
||||
type: FOLLOW_REQUESTS_FETCH_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -749,14 +749,14 @@ export function fetchFollowRequestsSuccess(accounts, next) {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_FETCH_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchFollowRequestsFail(error) {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -772,14 +772,14 @@ export function expandFollowRequests() {
|
||||
|
||||
api(getState).get(url).then(response => {
|
||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||
dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null))
|
||||
dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null));
|
||||
}).catch(error => dispatch(expandFollowRequestsFail(error)));
|
||||
};
|
||||
};
|
||||
|
||||
export function expandFollowRequestsRequest() {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_EXPAND_REQUEST
|
||||
type: FOLLOW_REQUESTS_EXPAND_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -787,14 +787,14 @@ export function expandFollowRequestsSuccess(accounts, next) {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_EXPAND_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandFollowRequestsFail(error) {
|
||||
return {
|
||||
type: FOLLOW_REQUESTS_EXPAND_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -812,14 +812,14 @@ export function authorizeFollowRequest(id) {
|
||||
export function authorizeFollowRequestRequest(id) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_AUTHORIZE_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function authorizeFollowRequestSuccess(id) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -827,7 +827,7 @@ export function authorizeFollowRequestFail(id, error) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_AUTHORIZE_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -846,14 +846,14 @@ export function rejectFollowRequest(id) {
|
||||
export function rejectFollowRequestRequest(id) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_REJECT_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
export function rejectFollowRequestSuccess(id) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_REJECT_SUCCESS,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -861,6 +861,6 @@ export function rejectFollowRequestFail(id, error) {
|
||||
return {
|
||||
type: FOLLOW_REQUEST_REJECT_FAIL,
|
||||
id,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -5,13 +5,13 @@ export const ALERT_CLEAR = 'ALERT_CLEAR';
|
||||
export function dismissAlert(alert) {
|
||||
return {
|
||||
type: ALERT_DISMISS,
|
||||
alert
|
||||
alert,
|
||||
};
|
||||
};
|
||||
|
||||
export function clearAlert() {
|
||||
return {
|
||||
type: ALERT_CLEAR
|
||||
type: ALERT_CLEAR,
|
||||
};
|
||||
};
|
||||
|
||||
@ -19,6 +19,6 @@ export function showAlert(title, message) {
|
||||
return {
|
||||
type: ALERT_SHOW,
|
||||
title,
|
||||
message
|
||||
message,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
import { fetchRelationships } from './accounts';
|
||||
|
||||
export const BLOCKS_FETCH_REQUEST = 'BLOCKS_FETCH_REQUEST';
|
||||
@ -23,7 +23,7 @@ export function fetchBlocks() {
|
||||
|
||||
export function fetchBlocksRequest() {
|
||||
return {
|
||||
type: BLOCKS_FETCH_REQUEST
|
||||
type: BLOCKS_FETCH_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -31,14 +31,14 @@ export function fetchBlocksSuccess(accounts, next) {
|
||||
return {
|
||||
type: BLOCKS_FETCH_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchBlocksFail(error) {
|
||||
return {
|
||||
type: BLOCKS_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ export function expandBlocks() {
|
||||
|
||||
export function expandBlocksRequest() {
|
||||
return {
|
||||
type: BLOCKS_EXPAND_REQUEST
|
||||
type: BLOCKS_EXPAND_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -70,13 +70,13 @@ export function expandBlocksSuccess(accounts, next) {
|
||||
return {
|
||||
type: BLOCKS_EXPAND_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandBlocksFail(error) {
|
||||
return {
|
||||
type: BLOCKS_EXPAND_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ export function fetchStatusCardRequest(id) {
|
||||
return {
|
||||
type: STATUS_CARD_FETCH_REQUEST,
|
||||
id,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -37,7 +37,7 @@ export function fetchStatusCardSuccess(id, card) {
|
||||
type: STATUS_CARD_FETCH_SUCCESS,
|
||||
id,
|
||||
card,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -47,6 +47,6 @@ export function fetchStatusCardFail(id, error) {
|
||||
id,
|
||||
error,
|
||||
skipLoading: true,
|
||||
skipAlert: true
|
||||
skipAlert: true,
|
||||
};
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ export const COMPOSE_EMOJI_INSERT = 'COMPOSE_EMOJI_INSERT';
|
||||
export function changeCompose(text) {
|
||||
return {
|
||||
type: COMPOSE_CHANGE,
|
||||
text: text
|
||||
text: text,
|
||||
};
|
||||
};
|
||||
|
||||
@ -43,7 +43,7 @@ export function replyCompose(status, router) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: COMPOSE_REPLY,
|
||||
status: status
|
||||
status: status,
|
||||
});
|
||||
|
||||
if (!getState().getIn(['compose', 'mounted'])) {
|
||||
@ -54,7 +54,7 @@ export function replyCompose(status, router) {
|
||||
|
||||
export function cancelReplyCompose() {
|
||||
return {
|
||||
type: COMPOSE_REPLY_CANCEL
|
||||
type: COMPOSE_REPLY_CANCEL,
|
||||
};
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ export function mentionCompose(account, router) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: COMPOSE_MENTION,
|
||||
account: account
|
||||
account: account,
|
||||
});
|
||||
|
||||
if (!getState().getIn(['compose', 'mounted'])) {
|
||||
@ -84,11 +84,11 @@ export function submitCompose() {
|
||||
media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
|
||||
sensitive: getState().getIn(['compose', 'sensitive']),
|
||||
spoiler_text: getState().getIn(['compose', 'spoiler_text'], ''),
|
||||
visibility: getState().getIn(['compose', 'privacy'])
|
||||
visibility: getState().getIn(['compose', 'privacy']),
|
||||
}, {
|
||||
headers: {
|
||||
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey'])
|
||||
}
|
||||
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
|
||||
},
|
||||
}).then(function (response) {
|
||||
dispatch(submitComposeSuccess({ ...response.data }));
|
||||
|
||||
@ -112,21 +112,21 @@ export function submitCompose() {
|
||||
|
||||
export function submitComposeRequest() {
|
||||
return {
|
||||
type: COMPOSE_SUBMIT_REQUEST
|
||||
type: COMPOSE_SUBMIT_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
export function submitComposeSuccess(status) {
|
||||
return {
|
||||
type: COMPOSE_SUBMIT_SUCCESS,
|
||||
status: status
|
||||
status: status,
|
||||
};
|
||||
};
|
||||
|
||||
export function submitComposeFail(error) {
|
||||
return {
|
||||
type: COMPOSE_SUBMIT_FAIL,
|
||||
error: error
|
||||
error: error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -144,7 +144,7 @@ export function uploadCompose(files) {
|
||||
api(getState).post('/api/v1/media', data, {
|
||||
onUploadProgress: function (e) {
|
||||
dispatch(uploadComposeProgress(e.loaded, e.total));
|
||||
}
|
||||
},
|
||||
}).then(function (response) {
|
||||
dispatch(uploadComposeSuccess(response.data));
|
||||
}).catch(function (error) {
|
||||
@ -156,7 +156,7 @@ export function uploadCompose(files) {
|
||||
export function uploadComposeRequest() {
|
||||
return {
|
||||
type: COMPOSE_UPLOAD_REQUEST,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -164,7 +164,7 @@ export function uploadComposeProgress(loaded, total) {
|
||||
return {
|
||||
type: COMPOSE_UPLOAD_PROGRESS,
|
||||
loaded: loaded,
|
||||
total: total
|
||||
total: total,
|
||||
};
|
||||
};
|
||||
|
||||
@ -172,7 +172,7 @@ export function uploadComposeSuccess(media) {
|
||||
return {
|
||||
type: COMPOSE_UPLOAD_SUCCESS,
|
||||
media: media,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
@ -180,20 +180,20 @@ export function uploadComposeFail(error) {
|
||||
return {
|
||||
type: COMPOSE_UPLOAD_FAIL,
|
||||
error: error,
|
||||
skipLoading: true
|
||||
skipLoading: true,
|
||||
};
|
||||
};
|
||||
|
||||
export function undoUploadCompose(media_id) {
|
||||
return {
|
||||
type: COMPOSE_UPLOAD_UNDO,
|
||||
media_id: media_id
|
||||
media_id: media_id,
|
||||
};
|
||||
};
|
||||
|
||||
export function clearComposeSuggestions() {
|
||||
return {
|
||||
type: COMPOSE_SUGGESTIONS_CLEAR
|
||||
type: COMPOSE_SUGGESTIONS_CLEAR,
|
||||
};
|
||||
};
|
||||
|
||||
@ -203,8 +203,8 @@ export function fetchComposeSuggestions(token) {
|
||||
params: {
|
||||
q: token,
|
||||
resolve: false,
|
||||
limit: 4
|
||||
}
|
||||
limit: 4,
|
||||
},
|
||||
}).then(response => {
|
||||
dispatch(readyComposeSuggestions(token, response.data));
|
||||
});
|
||||
@ -215,7 +215,7 @@ export function readyComposeSuggestions(token, accounts) {
|
||||
return {
|
||||
type: COMPOSE_SUGGESTIONS_READY,
|
||||
token,
|
||||
accounts
|
||||
accounts,
|
||||
};
|
||||
};
|
||||
|
||||
@ -227,20 +227,20 @@ export function selectComposeSuggestion(position, token, accountId) {
|
||||
type: COMPOSE_SUGGESTION_SELECT,
|
||||
position,
|
||||
token,
|
||||
completion
|
||||
completion,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export function mountCompose() {
|
||||
return {
|
||||
type: COMPOSE_MOUNT
|
||||
type: COMPOSE_MOUNT,
|
||||
};
|
||||
};
|
||||
|
||||
export function unmountCompose() {
|
||||
return {
|
||||
type: COMPOSE_UNMOUNT
|
||||
type: COMPOSE_UNMOUNT,
|
||||
};
|
||||
};
|
||||
|
||||
@ -252,21 +252,21 @@ export function changeComposeSensitivity() {
|
||||
|
||||
export function changeComposeSpoilerness() {
|
||||
return {
|
||||
type: COMPOSE_SPOILERNESS_CHANGE
|
||||
type: COMPOSE_SPOILERNESS_CHANGE,
|
||||
};
|
||||
};
|
||||
|
||||
export function changeComposeSpoilerText(text) {
|
||||
return {
|
||||
type: COMPOSE_SPOILER_TEXT_CHANGE,
|
||||
text
|
||||
text,
|
||||
};
|
||||
};
|
||||
|
||||
export function changeComposeVisibility(value) {
|
||||
return {
|
||||
type: COMPOSE_VISIBILITY_CHANGE,
|
||||
value
|
||||
value,
|
||||
};
|
||||
};
|
||||
|
||||
@ -274,6 +274,6 @@ export function insertEmojiCompose(position, emoji) {
|
||||
return {
|
||||
type: COMPOSE_EMOJI_INSERT,
|
||||
position,
|
||||
emoji
|
||||
emoji,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
|
||||
export const DOMAIN_BLOCK_REQUEST = 'DOMAIN_BLOCK_REQUEST';
|
||||
export const DOMAIN_BLOCK_SUCCESS = 'DOMAIN_BLOCK_SUCCESS';
|
||||
@ -27,7 +27,7 @@ export function blockDomain(domain, accountId) {
|
||||
export function blockDomainRequest(domain) {
|
||||
return {
|
||||
type: DOMAIN_BLOCK_REQUEST,
|
||||
domain
|
||||
domain,
|
||||
};
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ export function blockDomainSuccess(domain, accountId) {
|
||||
return {
|
||||
type: DOMAIN_BLOCK_SUCCESS,
|
||||
domain,
|
||||
accountId
|
||||
accountId,
|
||||
};
|
||||
};
|
||||
|
||||
@ -43,7 +43,7 @@ export function blockDomainFail(domain, error) {
|
||||
return {
|
||||
type: DOMAIN_BLOCK_FAIL,
|
||||
domain,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ export function unblockDomain(domain, accountId) {
|
||||
export function unblockDomainRequest(domain) {
|
||||
return {
|
||||
type: DOMAIN_UNBLOCK_REQUEST,
|
||||
domain
|
||||
domain,
|
||||
};
|
||||
};
|
||||
|
||||
@ -70,7 +70,7 @@ export function unblockDomainSuccess(domain, accountId) {
|
||||
return {
|
||||
type: DOMAIN_UNBLOCK_SUCCESS,
|
||||
domain,
|
||||
accountId
|
||||
accountId,
|
||||
};
|
||||
};
|
||||
|
||||
@ -78,7 +78,7 @@ export function unblockDomainFail(domain, error) {
|
||||
return {
|
||||
type: DOMAIN_UNBLOCK_FAIL,
|
||||
domain,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -97,7 +97,7 @@ export function fetchDomainBlocks() {
|
||||
|
||||
export function fetchDomainBlocksRequest() {
|
||||
return {
|
||||
type: DOMAIN_BLOCKS_FETCH_REQUEST
|
||||
type: DOMAIN_BLOCKS_FETCH_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -105,13 +105,13 @@ export function fetchDomainBlocksSuccess(domains, next) {
|
||||
return {
|
||||
type: DOMAIN_BLOCKS_FETCH_SUCCESS,
|
||||
domains,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchDomainBlocksFail(error) {
|
||||
return {
|
||||
type: DOMAIN_BLOCKS_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
|
||||
export const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST';
|
||||
export const FAVOURITED_STATUSES_FETCH_SUCCESS = 'FAVOURITED_STATUSES_FETCH_SUCCESS';
|
||||
@ -23,7 +23,7 @@ export function fetchFavouritedStatuses() {
|
||||
|
||||
export function fetchFavouritedStatusesRequest() {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_FETCH_REQUEST
|
||||
type: FAVOURITED_STATUSES_FETCH_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -31,14 +31,14 @@ export function fetchFavouritedStatusesSuccess(statuses, next) {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_FETCH_SUCCESS,
|
||||
statuses,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchFavouritedStatusesFail(error) {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -63,7 +63,7 @@ export function expandFavouritedStatuses() {
|
||||
|
||||
export function expandFavouritedStatusesRequest() {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_EXPAND_REQUEST
|
||||
type: FAVOURITED_STATUSES_EXPAND_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -71,13 +71,13 @@ export function expandFavouritedStatusesSuccess(statuses, next) {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_EXPAND_SUCCESS,
|
||||
statuses,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandFavouritedStatusesFail(error) {
|
||||
return {
|
||||
type: FAVOURITED_STATUSES_EXPAND_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api from '../api'
|
||||
import api from '../api';
|
||||
|
||||
export const REBLOG_REQUEST = 'REBLOG_REQUEST';
|
||||
export const REBLOG_SUCCESS = 'REBLOG_SUCCESS';
|
||||
@ -53,7 +53,7 @@ export function unreblog(status) {
|
||||
export function reblogRequest(status) {
|
||||
return {
|
||||
type: REBLOG_REQUEST,
|
||||
status: status
|
||||
status: status,
|
||||
};
|
||||
};
|
||||
|
||||
@ -61,7 +61,7 @@ export function reblogSuccess(status, response) {
|
||||
return {
|
||||
type: REBLOG_SUCCESS,
|
||||
status: status,
|
||||
response: response
|
||||
response: response,
|
||||
};
|
||||
};
|
||||
|
||||
@ -69,14 +69,14 @@ export function reblogFail(status, error) {
|
||||
return {
|
||||
type: REBLOG_FAIL,
|
||||
status: status,
|
||||
error: error
|
||||
error: error,
|
||||
};
|
||||
};
|
||||
|
||||
export function unreblogRequest(status) {
|
||||
return {
|
||||
type: UNREBLOG_REQUEST,
|
||||
status: status
|
||||
status: status,
|
||||
};
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@ export function unreblogSuccess(status, response) {
|
||||
return {
|
||||
type: UNREBLOG_SUCCESS,
|
||||
status: status,
|
||||
response: response
|
||||
response: response,
|
||||
};
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@ export function unreblogFail(status, error) {
|
||||
return {
|
||||
type: UNREBLOG_FAIL,
|
||||
status: status,
|
||||
error: error
|
||||
error: error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -123,7 +123,7 @@ export function unfavourite(status) {
|
||||
export function favouriteRequest(status) {
|
||||
return {
|
||||
type: FAVOURITE_REQUEST,
|
||||
status: status
|
||||
status: status,
|
||||
};
|
||||
};
|
||||
|
||||
@ -131,7 +131,7 @@ export function favouriteSuccess(status, response) {
|
||||
return {
|
||||
type: FAVOURITE_SUCCESS,
|
||||
status: status,
|
||||
response: response
|
||||
response: response,
|
||||
};
|
||||
};
|
||||
|
||||
@ -139,14 +139,14 @@ export function favouriteFail(status, error) {
|
||||
return {
|
||||
type: FAVOURITE_FAIL,
|
||||
status: status,
|
||||
error: error
|
||||
error: error,
|
||||
};
|
||||
};
|
||||
|
||||
export function unfavouriteRequest(status) {
|
||||
return {
|
||||
type: UNFAVOURITE_REQUEST,
|
||||
status: status
|
||||
status: status,
|
||||
};
|
||||
};
|
||||
|
||||
@ -154,7 +154,7 @@ export function unfavouriteSuccess(status, response) {
|
||||
return {
|
||||
type: UNFAVOURITE_SUCCESS,
|
||||
status: status,
|
||||
response: response
|
||||
response: response,
|
||||
};
|
||||
};
|
||||
|
||||
@ -162,7 +162,7 @@ export function unfavouriteFail(status, error) {
|
||||
return {
|
||||
type: UNFAVOURITE_FAIL,
|
||||
status: status,
|
||||
error: error
|
||||
error: error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -181,7 +181,7 @@ export function fetchReblogs(id) {
|
||||
export function fetchReblogsRequest(id) {
|
||||
return {
|
||||
type: REBLOGS_FETCH_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -189,14 +189,14 @@ export function fetchReblogsSuccess(id, accounts) {
|
||||
return {
|
||||
type: REBLOGS_FETCH_SUCCESS,
|
||||
id,
|
||||
accounts
|
||||
accounts,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchReblogsFail(id, error) {
|
||||
return {
|
||||
type: REBLOGS_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -215,7 +215,7 @@ export function fetchFavourites(id) {
|
||||
export function fetchFavouritesRequest(id) {
|
||||
return {
|
||||
type: FAVOURITES_FETCH_REQUEST,
|
||||
id
|
||||
id,
|
||||
};
|
||||
};
|
||||
|
||||
@ -223,13 +223,13 @@ export function fetchFavouritesSuccess(id, accounts) {
|
||||
return {
|
||||
type: FAVOURITES_FETCH_SUCCESS,
|
||||
id,
|
||||
accounts
|
||||
accounts,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchFavouritesFail(id, error) {
|
||||
return {
|
||||
type: FAVOURITES_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -5,12 +5,12 @@ export function openModal(type, props) {
|
||||
return {
|
||||
type: MODAL_OPEN,
|
||||
modalType: type,
|
||||
modalProps: props
|
||||
modalProps: props,
|
||||
};
|
||||
};
|
||||
|
||||
export function closeModal() {
|
||||
return {
|
||||
type: MODAL_CLOSE
|
||||
type: MODAL_CLOSE,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
import { fetchRelationships } from './accounts';
|
||||
|
||||
export const MUTES_FETCH_REQUEST = 'MUTES_FETCH_REQUEST';
|
||||
@ -23,7 +23,7 @@ export function fetchMutes() {
|
||||
|
||||
export function fetchMutesRequest() {
|
||||
return {
|
||||
type: MUTES_FETCH_REQUEST
|
||||
type: MUTES_FETCH_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -31,14 +31,14 @@ export function fetchMutesSuccess(accounts, next) {
|
||||
return {
|
||||
type: MUTES_FETCH_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchMutesFail(error) {
|
||||
return {
|
||||
type: MUTES_FETCH_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ export function expandMutes() {
|
||||
|
||||
export function expandMutesRequest() {
|
||||
return {
|
||||
type: MUTES_EXPAND_REQUEST
|
||||
type: MUTES_EXPAND_REQUEST,
|
||||
};
|
||||
};
|
||||
|
||||
@ -70,13 +70,13 @@ export function expandMutesSuccess(accounts, next) {
|
||||
return {
|
||||
type: MUTES_EXPAND_SUCCESS,
|
||||
accounts,
|
||||
next
|
||||
next,
|
||||
};
|
||||
};
|
||||
|
||||
export function expandMutesFail(error) {
|
||||
return {
|
||||
type: MUTES_EXPAND_FAIL,
|
||||
error
|
||||
error,
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import api, { getLinks } from '../api';
|
||||
import Immutable from 'immutable';
|
||||
import IntlMessageFormat from 'intl-messageformat';
|
||||
import { fetchRelationships } from './accounts';
|
||||
@ -33,7 +33,7 @@ const unescapeHTML = (html) => {
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = html;
|
||||
return wrapper.textContent;
|
||||
}
|
||||
};
|
||||
|
||||
export function updateNotifications(notification, intlMessages, intlLocale) {
|
||||
return (dispatch, getState) => {
|
||||
@ -45,7 +45,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
|
||||
notification,
|
||||
account: notification.account,
|
||||
status: notification.status,
|
||||
meta: playSound ? { sound: 'boop' } : undefined
|
||||
meta: playSound ? { sound: 'boop' } : undefined,
|
||||
});
|
||||
|
||||
fetchRelatedRelationships(dispatch, [notification]);
|
||||
@ -99,7 +99,7 @@ export function refreshNotifications() {
|
||||
export function refreshNotificationsRequest(skipLoading) {
|
||||
return {
|
||||
type: NOTIFICATIONS_REFRESH_REQUEST,
|
||||
skipLoading
|
||||
skipLoading,
|
||||
};
|
||||
};
|
||||
|
||||