Enable eslint:recommended ruleset (#22433)

* Enable ESLint recommended ruleset

* Disable failing ESLint recommended rules

* Remove rules shadowed by eslint:recommended
main
Nick Schonning 2022-12-18 10:51:37 -05:00 committed by GitHub
parent 2889c68610
commit 06b68490d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 350 additions and 348 deletions

View File

@ -1,6 +1,10 @@
module.exports = { module.exports = {
root: true, root: true,
extends: [
'eslint:recommended',
],
env: { env: {
browser: true, browser: true,
node: true, node: true,
@ -64,8 +68,8 @@ module.exports = {
eqeqeq: 'error', eqeqeq: 'error',
indent: ['warn', 2], indent: ['warn', 2],
'jsx-quotes': ['error', 'prefer-single'], 'jsx-quotes': ['error', 'prefer-single'],
'no-case-declarations': 'off',
'no-catch-shadow': 'error', 'no-catch-shadow': 'error',
'no-cond-assign': 'error',
'no-console': [ 'no-console': [
'warn', 'warn',
{ {
@ -75,18 +79,16 @@ module.exports = {
], ],
}, },
], ],
'no-fallthrough': 'error', 'no-empty': 'off',
'no-irregular-whitespace': 'error',
'no-mixed-spaces-and-tabs': 'warn',
'no-nested-ternary': 'warn', 'no-nested-ternary': 'warn',
'no-prototype-builtins': 'off',
'no-restricted-properties': [ 'no-restricted-properties': [
'error', 'error',
{ property: 'substring', message: 'Use .slice instead of .substring.' }, { property: 'substring', message: 'Use .slice instead of .substring.' },
{ property: 'substr', message: 'Use .slice instead of .substr.' }, { property: 'substr', message: 'Use .slice instead of .substr.' },
], ],
'no-self-assign': 'off',
'no-trailing-spaces': 'warn', 'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unused-expressions': 'error', 'no-unused-expressions': 'error',
'no-unused-vars': [ 'no-unused-vars': [
'error', 'error',
@ -96,6 +98,7 @@ module.exports = {
ignoreRestSiblings: true, ignoreRestSiblings: true,
}, },
], ],
'no-useless-escape': 'off',
'object-curly-spacing': ['error', 'always'], 'object-curly-spacing': ['error', 'always'],
'padded-blocks': [ 'padded-blocks': [
'error', 'error',
@ -105,7 +108,6 @@ module.exports = {
], ],
quotes: ['error', 'single'], quotes: ['error', 'single'],
semi: 'error', semi: 'error',
strict: 'off',
'valid-typeof': 'error', 'valid-typeof': 'error',
'react/jsx-boolean-value': 'error', 'react/jsx-boolean-value': 'error',

View File

@ -14,24 +14,24 @@ export function submitAccountNote(id, value) {
dispatch(submitAccountNoteSuccess(response.data)); dispatch(submitAccountNoteSuccess(response.data));
}).catch(error => dispatch(submitAccountNoteFail(error))); }).catch(error => dispatch(submitAccountNoteFail(error)));
}; };
}; }
export function submitAccountNoteRequest() { export function submitAccountNoteRequest() {
return { return {
type: ACCOUNT_NOTE_SUBMIT_REQUEST, type: ACCOUNT_NOTE_SUBMIT_REQUEST,
}; };
}; }
export function submitAccountNoteSuccess(relationship) { export function submitAccountNoteSuccess(relationship) {
return { return {
type: ACCOUNT_NOTE_SUBMIT_SUCCESS, type: ACCOUNT_NOTE_SUBMIT_SUCCESS,
relationship, relationship,
}; };
}; }
export function submitAccountNoteFail(error) { export function submitAccountNoteFail(error) {
return { return {
type: ACCOUNT_NOTE_SUBMIT_FAIL, type: ACCOUNT_NOTE_SUBMIT_FAIL,
error, error,
}; };
}; }

View File

@ -91,7 +91,7 @@ export function fetchAccount(id) {
dispatch(fetchAccountFail(id, error)); dispatch(fetchAccountFail(id, error));
}); });
}; };
}; }
export const lookupAccount = acct => (dispatch, getState) => { export const lookupAccount = acct => (dispatch, getState) => {
dispatch(lookupAccountRequest(acct)); dispatch(lookupAccountRequest(acct));
@ -126,13 +126,13 @@ export function fetchAccountRequest(id) {
type: ACCOUNT_FETCH_REQUEST, type: ACCOUNT_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchAccountSuccess() { export function fetchAccountSuccess() {
return { return {
type: ACCOUNT_FETCH_SUCCESS, type: ACCOUNT_FETCH_SUCCESS,
}; };
}; }
export function fetchAccountFail(id, error) { export function fetchAccountFail(id, error) {
return { return {
@ -141,7 +141,7 @@ export function fetchAccountFail(id, error) {
error, error,
skipAlert: true, skipAlert: true,
}; };
}; }
export function followAccount(id, options = { reblogs: true }) { export function followAccount(id, options = { reblogs: true }) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -156,7 +156,7 @@ export function followAccount(id, options = { reblogs: true }) {
dispatch(followAccountFail(error, locked)); dispatch(followAccountFail(error, locked));
}); });
}; };
}; }
export function unfollowAccount(id) { export function unfollowAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -168,7 +168,7 @@ export function unfollowAccount(id) {
dispatch(unfollowAccountFail(error)); dispatch(unfollowAccountFail(error));
}); });
}; };
}; }
export function followAccountRequest(id, locked) { export function followAccountRequest(id, locked) {
return { return {
@ -177,7 +177,7 @@ export function followAccountRequest(id, locked) {
locked, locked,
skipLoading: true, skipLoading: true,
}; };
}; }
export function followAccountSuccess(relationship, alreadyFollowing) { export function followAccountSuccess(relationship, alreadyFollowing) {
return { return {
@ -186,7 +186,7 @@ export function followAccountSuccess(relationship, alreadyFollowing) {
alreadyFollowing, alreadyFollowing,
skipLoading: true, skipLoading: true,
}; };
}; }
export function followAccountFail(error, locked) { export function followAccountFail(error, locked) {
return { return {
@ -195,7 +195,7 @@ export function followAccountFail(error, locked) {
locked, locked,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfollowAccountRequest(id) { export function unfollowAccountRequest(id) {
return { return {
@ -203,7 +203,7 @@ export function unfollowAccountRequest(id) {
id, id,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfollowAccountSuccess(relationship, statuses) { export function unfollowAccountSuccess(relationship, statuses) {
return { return {
@ -212,7 +212,7 @@ export function unfollowAccountSuccess(relationship, statuses) {
statuses, statuses,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfollowAccountFail(error) { export function unfollowAccountFail(error) {
return { return {
@ -220,7 +220,7 @@ export function unfollowAccountFail(error) {
error, error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function blockAccount(id) { export function blockAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -233,7 +233,7 @@ export function blockAccount(id) {
dispatch(blockAccountFail(id, error)); dispatch(blockAccountFail(id, error));
}); });
}; };
}; }
export function unblockAccount(id) { export function unblockAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -245,14 +245,14 @@ export function unblockAccount(id) {
dispatch(unblockAccountFail(id, error)); dispatch(unblockAccountFail(id, error));
}); });
}; };
}; }
export function blockAccountRequest(id) { export function blockAccountRequest(id) {
return { return {
type: ACCOUNT_BLOCK_REQUEST, type: ACCOUNT_BLOCK_REQUEST,
id, id,
}; };
}; }
export function blockAccountSuccess(relationship, statuses) { export function blockAccountSuccess(relationship, statuses) {
return { return {
@ -260,35 +260,35 @@ export function blockAccountSuccess(relationship, statuses) {
relationship, relationship,
statuses, statuses,
}; };
}; }
export function blockAccountFail(error) { export function blockAccountFail(error) {
return { return {
type: ACCOUNT_BLOCK_FAIL, type: ACCOUNT_BLOCK_FAIL,
error, error,
}; };
}; }
export function unblockAccountRequest(id) { export function unblockAccountRequest(id) {
return { return {
type: ACCOUNT_UNBLOCK_REQUEST, type: ACCOUNT_UNBLOCK_REQUEST,
id, id,
}; };
}; }
export function unblockAccountSuccess(relationship) { export function unblockAccountSuccess(relationship) {
return { return {
type: ACCOUNT_UNBLOCK_SUCCESS, type: ACCOUNT_UNBLOCK_SUCCESS,
relationship, relationship,
}; };
}; }
export function unblockAccountFail(error) { export function unblockAccountFail(error) {
return { return {
type: ACCOUNT_UNBLOCK_FAIL, type: ACCOUNT_UNBLOCK_FAIL,
error, error,
}; };
}; }
export function muteAccount(id, notifications, duration=0) { export function muteAccount(id, notifications, duration=0) {
@ -302,7 +302,7 @@ export function muteAccount(id, notifications, duration=0) {
dispatch(muteAccountFail(id, error)); dispatch(muteAccountFail(id, error));
}); });
}; };
}; }
export function unmuteAccount(id) { export function unmuteAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -314,14 +314,14 @@ export function unmuteAccount(id) {
dispatch(unmuteAccountFail(id, error)); dispatch(unmuteAccountFail(id, error));
}); });
}; };
}; }
export function muteAccountRequest(id) { export function muteAccountRequest(id) {
return { return {
type: ACCOUNT_MUTE_REQUEST, type: ACCOUNT_MUTE_REQUEST,
id, id,
}; };
}; }
export function muteAccountSuccess(relationship, statuses) { export function muteAccountSuccess(relationship, statuses) {
return { return {
@ -329,35 +329,35 @@ export function muteAccountSuccess(relationship, statuses) {
relationship, relationship,
statuses, statuses,
}; };
}; }
export function muteAccountFail(error) { export function muteAccountFail(error) {
return { return {
type: ACCOUNT_MUTE_FAIL, type: ACCOUNT_MUTE_FAIL,
error, error,
}; };
}; }
export function unmuteAccountRequest(id) { export function unmuteAccountRequest(id) {
return { return {
type: ACCOUNT_UNMUTE_REQUEST, type: ACCOUNT_UNMUTE_REQUEST,
id, id,
}; };
}; }
export function unmuteAccountSuccess(relationship) { export function unmuteAccountSuccess(relationship) {
return { return {
type: ACCOUNT_UNMUTE_SUCCESS, type: ACCOUNT_UNMUTE_SUCCESS,
relationship, relationship,
}; };
}; }
export function unmuteAccountFail(error) { export function unmuteAccountFail(error) {
return { return {
type: ACCOUNT_UNMUTE_FAIL, type: ACCOUNT_UNMUTE_FAIL,
error, error,
}; };
}; }
export function fetchFollowers(id) { export function fetchFollowers(id) {
@ -374,14 +374,14 @@ export function fetchFollowers(id) {
dispatch(fetchFollowersFail(id, error)); dispatch(fetchFollowersFail(id, error));
}); });
}; };
}; }
export function fetchFollowersRequest(id) { export function fetchFollowersRequest(id) {
return { return {
type: FOLLOWERS_FETCH_REQUEST, type: FOLLOWERS_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchFollowersSuccess(id, accounts, next) { export function fetchFollowersSuccess(id, accounts, next) {
return { return {
@ -390,7 +390,7 @@ export function fetchFollowersSuccess(id, accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function fetchFollowersFail(id, error) { export function fetchFollowersFail(id, error) {
return { return {
@ -399,7 +399,7 @@ export function fetchFollowersFail(id, error) {
error, error,
skipNotFound: true, skipNotFound: true,
}; };
}; }
export function expandFollowers(id) { export function expandFollowers(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -421,14 +421,14 @@ export function expandFollowers(id) {
dispatch(expandFollowersFail(id, error)); dispatch(expandFollowersFail(id, error));
}); });
}; };
}; }
export function expandFollowersRequest(id) { export function expandFollowersRequest(id) {
return { return {
type: FOLLOWERS_EXPAND_REQUEST, type: FOLLOWERS_EXPAND_REQUEST,
id, id,
}; };
}; }
export function expandFollowersSuccess(id, accounts, next) { export function expandFollowersSuccess(id, accounts, next) {
return { return {
@ -437,7 +437,7 @@ export function expandFollowersSuccess(id, accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function expandFollowersFail(id, error) { export function expandFollowersFail(id, error) {
return { return {
@ -445,7 +445,7 @@ export function expandFollowersFail(id, error) {
id, id,
error, error,
}; };
}; }
export function fetchFollowing(id) { export function fetchFollowing(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -461,14 +461,14 @@ export function fetchFollowing(id) {
dispatch(fetchFollowingFail(id, error)); dispatch(fetchFollowingFail(id, error));
}); });
}; };
}; }
export function fetchFollowingRequest(id) { export function fetchFollowingRequest(id) {
return { return {
type: FOLLOWING_FETCH_REQUEST, type: FOLLOWING_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchFollowingSuccess(id, accounts, next) { export function fetchFollowingSuccess(id, accounts, next) {
return { return {
@ -477,7 +477,7 @@ export function fetchFollowingSuccess(id, accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function fetchFollowingFail(id, error) { export function fetchFollowingFail(id, error) {
return { return {
@ -486,7 +486,7 @@ export function fetchFollowingFail(id, error) {
error, error,
skipNotFound: true, skipNotFound: true,
}; };
}; }
export function expandFollowing(id) { export function expandFollowing(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -508,14 +508,14 @@ export function expandFollowing(id) {
dispatch(expandFollowingFail(id, error)); dispatch(expandFollowingFail(id, error));
}); });
}; };
}; }
export function expandFollowingRequest(id) { export function expandFollowingRequest(id) {
return { return {
type: FOLLOWING_EXPAND_REQUEST, type: FOLLOWING_EXPAND_REQUEST,
id, id,
}; };
}; }
export function expandFollowingSuccess(id, accounts, next) { export function expandFollowingSuccess(id, accounts, next) {
return { return {
@ -524,7 +524,7 @@ export function expandFollowingSuccess(id, accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function expandFollowingFail(id, error) { export function expandFollowingFail(id, error) {
return { return {
@ -532,7 +532,7 @@ export function expandFollowingFail(id, error) {
id, id,
error, error,
}; };
}; }
export function fetchRelationships(accountIds) { export function fetchRelationships(accountIds) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -553,7 +553,7 @@ export function fetchRelationships(accountIds) {
dispatch(fetchRelationshipsFail(error)); dispatch(fetchRelationshipsFail(error));
}); });
}; };
}; }
export function fetchRelationshipsRequest(ids) { export function fetchRelationshipsRequest(ids) {
return { return {
@ -561,7 +561,7 @@ export function fetchRelationshipsRequest(ids) {
ids, ids,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchRelationshipsSuccess(relationships) { export function fetchRelationshipsSuccess(relationships) {
return { return {
@ -569,7 +569,7 @@ export function fetchRelationshipsSuccess(relationships) {
relationships, relationships,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchRelationshipsFail(error) { export function fetchRelationshipsFail(error) {
return { return {
@ -578,7 +578,7 @@ export function fetchRelationshipsFail(error) {
skipLoading: true, skipLoading: true,
skipNotFound: true, skipNotFound: true,
}; };
}; }
export function fetchFollowRequests() { export function fetchFollowRequests() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -590,13 +590,13 @@ export function fetchFollowRequests() {
dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null)); dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null));
}).catch(error => dispatch(fetchFollowRequestsFail(error))); }).catch(error => dispatch(fetchFollowRequestsFail(error)));
}; };
}; }
export function fetchFollowRequestsRequest() { export function fetchFollowRequestsRequest() {
return { return {
type: FOLLOW_REQUESTS_FETCH_REQUEST, type: FOLLOW_REQUESTS_FETCH_REQUEST,
}; };
}; }
export function fetchFollowRequestsSuccess(accounts, next) { export function fetchFollowRequestsSuccess(accounts, next) {
return { return {
@ -604,14 +604,14 @@ export function fetchFollowRequestsSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function fetchFollowRequestsFail(error) { export function fetchFollowRequestsFail(error) {
return { return {
type: FOLLOW_REQUESTS_FETCH_FAIL, type: FOLLOW_REQUESTS_FETCH_FAIL,
error, error,
}; };
}; }
export function expandFollowRequests() { export function expandFollowRequests() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -629,13 +629,13 @@ export function expandFollowRequests() {
dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null)); dispatch(expandFollowRequestsSuccess(response.data, next ? next.uri : null));
}).catch(error => dispatch(expandFollowRequestsFail(error))); }).catch(error => dispatch(expandFollowRequestsFail(error)));
}; };
}; }
export function expandFollowRequestsRequest() { export function expandFollowRequestsRequest() {
return { return {
type: FOLLOW_REQUESTS_EXPAND_REQUEST, type: FOLLOW_REQUESTS_EXPAND_REQUEST,
}; };
}; }
export function expandFollowRequestsSuccess(accounts, next) { export function expandFollowRequestsSuccess(accounts, next) {
return { return {
@ -643,14 +643,14 @@ export function expandFollowRequestsSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function expandFollowRequestsFail(error) { export function expandFollowRequestsFail(error) {
return { return {
type: FOLLOW_REQUESTS_EXPAND_FAIL, type: FOLLOW_REQUESTS_EXPAND_FAIL,
error, error,
}; };
}; }
export function authorizeFollowRequest(id) { export function authorizeFollowRequest(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -661,21 +661,21 @@ export function authorizeFollowRequest(id) {
.then(() => dispatch(authorizeFollowRequestSuccess(id))) .then(() => dispatch(authorizeFollowRequestSuccess(id)))
.catch(error => dispatch(authorizeFollowRequestFail(id, error))); .catch(error => dispatch(authorizeFollowRequestFail(id, error)));
}; };
}; }
export function authorizeFollowRequestRequest(id) { export function authorizeFollowRequestRequest(id) {
return { return {
type: FOLLOW_REQUEST_AUTHORIZE_REQUEST, type: FOLLOW_REQUEST_AUTHORIZE_REQUEST,
id, id,
}; };
}; }
export function authorizeFollowRequestSuccess(id) { export function authorizeFollowRequestSuccess(id) {
return { return {
type: FOLLOW_REQUEST_AUTHORIZE_SUCCESS, type: FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
id, id,
}; };
}; }
export function authorizeFollowRequestFail(id, error) { export function authorizeFollowRequestFail(id, error) {
return { return {
@ -683,7 +683,7 @@ export function authorizeFollowRequestFail(id, error) {
id, id,
error, error,
}; };
}; }
export function rejectFollowRequest(id) { export function rejectFollowRequest(id) {
@ -695,21 +695,21 @@ export function rejectFollowRequest(id) {
.then(() => dispatch(rejectFollowRequestSuccess(id))) .then(() => dispatch(rejectFollowRequestSuccess(id)))
.catch(error => dispatch(rejectFollowRequestFail(id, error))); .catch(error => dispatch(rejectFollowRequestFail(id, error)));
}; };
}; }
export function rejectFollowRequestRequest(id) { export function rejectFollowRequestRequest(id) {
return { return {
type: FOLLOW_REQUEST_REJECT_REQUEST, type: FOLLOW_REQUEST_REJECT_REQUEST,
id, id,
}; };
}; }
export function rejectFollowRequestSuccess(id) { export function rejectFollowRequestSuccess(id) {
return { return {
type: FOLLOW_REQUEST_REJECT_SUCCESS, type: FOLLOW_REQUEST_REJECT_SUCCESS,
id, id,
}; };
}; }
export function rejectFollowRequestFail(id, error) { export function rejectFollowRequestFail(id, error) {
return { return {
@ -717,7 +717,7 @@ export function rejectFollowRequestFail(id, error) {
id, id,
error, error,
}; };
}; }
export function pinAccount(id) { export function pinAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -729,7 +729,7 @@ export function pinAccount(id) {
dispatch(pinAccountFail(error)); dispatch(pinAccountFail(error));
}); });
}; };
}; }
export function unpinAccount(id) { export function unpinAccount(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -741,49 +741,49 @@ export function unpinAccount(id) {
dispatch(unpinAccountFail(error)); dispatch(unpinAccountFail(error));
}); });
}; };
}; }
export function pinAccountRequest(id) { export function pinAccountRequest(id) {
return { return {
type: ACCOUNT_PIN_REQUEST, type: ACCOUNT_PIN_REQUEST,
id, id,
}; };
}; }
export function pinAccountSuccess(relationship) { export function pinAccountSuccess(relationship) {
return { return {
type: ACCOUNT_PIN_SUCCESS, type: ACCOUNT_PIN_SUCCESS,
relationship, relationship,
}; };
}; }
export function pinAccountFail(error) { export function pinAccountFail(error) {
return { return {
type: ACCOUNT_PIN_FAIL, type: ACCOUNT_PIN_FAIL,
error, error,
}; };
}; }
export function unpinAccountRequest(id) { export function unpinAccountRequest(id) {
return { return {
type: ACCOUNT_UNPIN_REQUEST, type: ACCOUNT_UNPIN_REQUEST,
id, id,
}; };
}; }
export function unpinAccountSuccess(relationship) { export function unpinAccountSuccess(relationship) {
return { return {
type: ACCOUNT_UNPIN_SUCCESS, type: ACCOUNT_UNPIN_SUCCESS,
relationship, relationship,
}; };
}; }
export function unpinAccountFail(error) { export function unpinAccountFail(error) {
return { return {
type: ACCOUNT_UNPIN_FAIL, type: ACCOUNT_UNPIN_FAIL,
error, error,
}; };
}; }
export const revealAccount = id => ({ export const revealAccount = id => ({
type: ACCOUNT_REVEAL, type: ACCOUNT_REVEAL,

View File

@ -17,13 +17,13 @@ export function dismissAlert(alert) {
type: ALERT_DISMISS, type: ALERT_DISMISS,
alert, alert,
}; };
}; }
export function clearAlert() { export function clearAlert() {
return { return {
type: ALERT_CLEAR, type: ALERT_CLEAR,
}; };
}; }
export function showAlert(title = messages.unexpectedTitle, message = messages.unexpectedMessage, message_values = undefined) { export function showAlert(title = messages.unexpectedTitle, message = messages.unexpectedMessage, message_values = undefined) {
return { return {
@ -32,7 +32,7 @@ export function showAlert(title = messages.unexpectedTitle, message = messages.u
message, message,
message_values, message_values,
}; };
}; }
export function showAlertForError(error, skipNotFound = false) { export function showAlertForError(error, skipNotFound = false) {
if (error.response) { if (error.response) {

View File

@ -24,13 +24,13 @@ export function fetchBlocks() {
dispatch(fetchRelationships(response.data.map(item => item.id))); dispatch(fetchRelationships(response.data.map(item => item.id)));
}).catch(error => dispatch(fetchBlocksFail(error))); }).catch(error => dispatch(fetchBlocksFail(error)));
}; };
}; }
export function fetchBlocksRequest() { export function fetchBlocksRequest() {
return { return {
type: BLOCKS_FETCH_REQUEST, type: BLOCKS_FETCH_REQUEST,
}; };
}; }
export function fetchBlocksSuccess(accounts, next) { export function fetchBlocksSuccess(accounts, next) {
return { return {
@ -38,14 +38,14 @@ export function fetchBlocksSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function fetchBlocksFail(error) { export function fetchBlocksFail(error) {
return { return {
type: BLOCKS_FETCH_FAIL, type: BLOCKS_FETCH_FAIL,
error, error,
}; };
}; }
export function expandBlocks() { export function expandBlocks() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -64,13 +64,13 @@ export function expandBlocks() {
dispatch(fetchRelationships(response.data.map(item => item.id))); dispatch(fetchRelationships(response.data.map(item => item.id)));
}).catch(error => dispatch(expandBlocksFail(error))); }).catch(error => dispatch(expandBlocksFail(error)));
}; };
}; }
export function expandBlocksRequest() { export function expandBlocksRequest() {
return { return {
type: BLOCKS_EXPAND_REQUEST, type: BLOCKS_EXPAND_REQUEST,
}; };
}; }
export function expandBlocksSuccess(accounts, next) { export function expandBlocksSuccess(accounts, next) {
return { return {
@ -78,14 +78,14 @@ export function expandBlocksSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function expandBlocksFail(error) { export function expandBlocksFail(error) {
return { return {
type: BLOCKS_EXPAND_FAIL, type: BLOCKS_EXPAND_FAIL,
error, error,
}; };
}; }
export function initBlockModal(account) { export function initBlockModal(account) {
return dispatch => { return dispatch => {

View File

@ -25,13 +25,13 @@ export function fetchBookmarkedStatuses() {
dispatch(fetchBookmarkedStatusesFail(error)); dispatch(fetchBookmarkedStatusesFail(error));
}); });
}; };
}; }
export function fetchBookmarkedStatusesRequest() { export function fetchBookmarkedStatusesRequest() {
return { return {
type: BOOKMARKED_STATUSES_FETCH_REQUEST, type: BOOKMARKED_STATUSES_FETCH_REQUEST,
}; };
}; }
export function fetchBookmarkedStatusesSuccess(statuses, next) { export function fetchBookmarkedStatusesSuccess(statuses, next) {
return { return {
@ -39,14 +39,14 @@ export function fetchBookmarkedStatusesSuccess(statuses, next) {
statuses, statuses,
next, next,
}; };
}; }
export function fetchBookmarkedStatusesFail(error) { export function fetchBookmarkedStatusesFail(error) {
return { return {
type: BOOKMARKED_STATUSES_FETCH_FAIL, type: BOOKMARKED_STATUSES_FETCH_FAIL,
error, error,
}; };
}; }
export function expandBookmarkedStatuses() { export function expandBookmarkedStatuses() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -66,13 +66,13 @@ export function expandBookmarkedStatuses() {
dispatch(expandBookmarkedStatusesFail(error)); dispatch(expandBookmarkedStatusesFail(error));
}); });
}; };
}; }
export function expandBookmarkedStatusesRequest() { export function expandBookmarkedStatusesRequest() {
return { return {
type: BOOKMARKED_STATUSES_EXPAND_REQUEST, type: BOOKMARKED_STATUSES_EXPAND_REQUEST,
}; };
}; }
export function expandBookmarkedStatusesSuccess(statuses, next) { export function expandBookmarkedStatusesSuccess(statuses, next) {
return { return {
@ -80,11 +80,11 @@ export function expandBookmarkedStatusesSuccess(statuses, next) {
statuses, statuses,
next, next,
}; };
}; }
export function expandBookmarkedStatusesFail(error) { export function expandBookmarkedStatusesFail(error) {
return { return {
type: BOOKMARKED_STATUSES_EXPAND_FAIL, type: BOOKMARKED_STATUSES_EXPAND_FAIL,
error, error,
}; };
}; }

View File

@ -15,7 +15,7 @@ export function addColumn(id, params) {
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }
export function removeColumn(uuid) { export function removeColumn(uuid) {
return dispatch => { return dispatch => {
@ -26,7 +26,7 @@ export function removeColumn(uuid) {
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }
export function moveColumn(uuid, direction) { export function moveColumn(uuid, direction) {
return dispatch => { return dispatch => {
@ -38,7 +38,7 @@ export function moveColumn(uuid, direction) {
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }
export function changeColumnParams(uuid, path, value) { export function changeColumnParams(uuid, path, value) {
return dispatch => { return dispatch => {

View File

@ -94,14 +94,14 @@ export function setComposeToStatus(status, text, spoiler_text) {
text, text,
spoiler_text, spoiler_text,
}; };
}; }
export function changeCompose(text) { export function changeCompose(text) {
return { return {
type: COMPOSE_CHANGE, type: COMPOSE_CHANGE,
text: text, text: text,
}; };
}; }
export function replyCompose(status, routerHistory) { export function replyCompose(status, routerHistory) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -112,19 +112,19 @@ export function replyCompose(status, routerHistory) {
ensureComposeIsVisible(getState, routerHistory); ensureComposeIsVisible(getState, routerHistory);
}; };
}; }
export function cancelReplyCompose() { export function cancelReplyCompose() {
return { return {
type: COMPOSE_REPLY_CANCEL, type: COMPOSE_REPLY_CANCEL,
}; };
}; }
export function resetCompose() { export function resetCompose() {
return { return {
type: COMPOSE_RESET, type: COMPOSE_RESET,
}; };
}; }
export function mentionCompose(account, routerHistory) { export function mentionCompose(account, routerHistory) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -135,7 +135,7 @@ export function mentionCompose(account, routerHistory) {
ensureComposeIsVisible(getState, routerHistory); ensureComposeIsVisible(getState, routerHistory);
}; };
}; }
export function directCompose(account, routerHistory) { export function directCompose(account, routerHistory) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -146,7 +146,7 @@ export function directCompose(account, routerHistory) {
ensureComposeIsVisible(getState, routerHistory); ensureComposeIsVisible(getState, routerHistory);
}; };
}; }
export function submitCompose(routerHistory) { export function submitCompose(routerHistory) {
return function (dispatch, getState) { return function (dispatch, getState) {
@ -211,27 +211,27 @@ export function submitCompose(routerHistory) {
dispatch(submitComposeFail(error)); dispatch(submitComposeFail(error));
}); });
}; };
}; }
export function submitComposeRequest() { export function submitComposeRequest() {
return { return {
type: COMPOSE_SUBMIT_REQUEST, type: COMPOSE_SUBMIT_REQUEST,
}; };
}; }
export function submitComposeSuccess(status) { export function submitComposeSuccess(status) {
return { return {
type: COMPOSE_SUBMIT_SUCCESS, type: COMPOSE_SUBMIT_SUCCESS,
status: status, status: status,
}; };
}; }
export function submitComposeFail(error) { export function submitComposeFail(error) {
return { return {
type: COMPOSE_SUBMIT_FAIL, type: COMPOSE_SUBMIT_FAIL,
error: error, error: error,
}; };
}; }
export function uploadCompose(files) { export function uploadCompose(files) {
return function (dispatch, getState) { return function (dispatch, getState) {
@ -294,9 +294,9 @@ export function uploadCompose(files) {
} }
}); });
}).catch(error => dispatch(uploadComposeFail(error))); }).catch(error => dispatch(uploadComposeFail(error)));
}
}; };
}; }
};
export const uploadComposeProcessing = () => ({ export const uploadComposeProcessing = () => ({
type: COMPOSE_UPLOAD_PROCESSING, type: COMPOSE_UPLOAD_PROCESSING,
@ -354,14 +354,14 @@ export function initMediaEditModal(id) {
dispatch(openModal('FOCAL_POINT', { id })); dispatch(openModal('FOCAL_POINT', { id }));
}; };
}; }
export function onChangeMediaDescription(description) { export function onChangeMediaDescription(description) {
return { return {
type: COMPOSE_CHANGE_MEDIA_DESCRIPTION, type: COMPOSE_CHANGE_MEDIA_DESCRIPTION,
description, description,
}; };
}; }
export function onChangeMediaFocus(focusX, focusY) { export function onChangeMediaFocus(focusX, focusY) {
return { return {
@ -369,7 +369,7 @@ export function onChangeMediaFocus(focusX, focusY) {
focusX, focusX,
focusY, focusY,
}; };
}; }
export function changeUploadCompose(id, params) { export function changeUploadCompose(id, params) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -381,14 +381,14 @@ export function changeUploadCompose(id, params) {
dispatch(changeUploadComposeFail(id, error)); dispatch(changeUploadComposeFail(id, error));
}); });
}; };
}; }
export function changeUploadComposeRequest() { export function changeUploadComposeRequest() {
return { return {
type: COMPOSE_UPLOAD_CHANGE_REQUEST, type: COMPOSE_UPLOAD_CHANGE_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function changeUploadComposeSuccess(media) { export function changeUploadComposeSuccess(media) {
return { return {
@ -396,7 +396,7 @@ export function changeUploadComposeSuccess(media) {
media: media, media: media,
skipLoading: true, skipLoading: true,
}; };
}; }
export function changeUploadComposeFail(error) { export function changeUploadComposeFail(error) {
return { return {
@ -404,14 +404,14 @@ export function changeUploadComposeFail(error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function uploadComposeRequest() { export function uploadComposeRequest() {
return { return {
type: COMPOSE_UPLOAD_REQUEST, type: COMPOSE_UPLOAD_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function uploadComposeProgress(loaded, total) { export function uploadComposeProgress(loaded, total) {
return { return {
@ -419,7 +419,7 @@ export function uploadComposeProgress(loaded, total) {
loaded: loaded, loaded: loaded,
total: total, total: total,
}; };
}; }
export function uploadComposeSuccess(media, file) { export function uploadComposeSuccess(media, file) {
return { return {
@ -428,7 +428,7 @@ export function uploadComposeSuccess(media, file) {
file: file, file: file,
skipLoading: true, skipLoading: true,
}; };
}; }
export function uploadComposeFail(error) { export function uploadComposeFail(error) {
return { return {
@ -436,14 +436,14 @@ export function uploadComposeFail(error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function undoUploadCompose(media_id) { export function undoUploadCompose(media_id) {
return { return {
type: COMPOSE_UPLOAD_UNDO, type: COMPOSE_UPLOAD_UNDO,
media_id: media_id, media_id: media_id,
}; };
}; }
export function clearComposeSuggestions() { export function clearComposeSuggestions() {
if (fetchComposeSuggestionsAccountsController) { if (fetchComposeSuggestionsAccountsController) {
@ -452,7 +452,7 @@ export function clearComposeSuggestions() {
return { return {
type: COMPOSE_SUGGESTIONS_CLEAR, type: COMPOSE_SUGGESTIONS_CLEAR,
}; };
}; }
const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) => { const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) => {
if (fetchComposeSuggestionsAccountsController) { if (fetchComposeSuggestionsAccountsController) {
@ -530,7 +530,7 @@ export function fetchComposeSuggestions(token) {
break; break;
} }
}; };
}; }
export function readyComposeSuggestionsEmojis(token, emojis) { export function readyComposeSuggestionsEmojis(token, emojis) {
return { return {
@ -538,7 +538,7 @@ export function readyComposeSuggestionsEmojis(token, emojis) {
token, token,
emojis, emojis,
}; };
}; }
export function readyComposeSuggestionsAccounts(token, accounts) { export function readyComposeSuggestionsAccounts(token, accounts) {
return { return {
@ -546,7 +546,7 @@ export function readyComposeSuggestionsAccounts(token, accounts) {
token, token,
accounts, accounts,
}; };
}; }
export const readyComposeSuggestionsTags = (token, tags) => ({ export const readyComposeSuggestionsTags = (token, tags) => ({
type: COMPOSE_SUGGESTIONS_READY, type: COMPOSE_SUGGESTIONS_READY,
@ -591,7 +591,7 @@ export function selectComposeSuggestion(position, token, suggestion, path) {
}); });
} }
}; };
}; }
export function updateSuggestionTags(token) { export function updateSuggestionTags(token) {
return { return {
@ -652,19 +652,19 @@ export function mountCompose() {
return { return {
type: COMPOSE_MOUNT, type: COMPOSE_MOUNT,
}; };
}; }
export function unmountCompose() { export function unmountCompose() {
return { return {
type: COMPOSE_UNMOUNT, type: COMPOSE_UNMOUNT,
}; };
}; }
export function changeComposeSensitivity() { export function changeComposeSensitivity() {
return { return {
type: COMPOSE_SENSITIVITY_CHANGE, type: COMPOSE_SENSITIVITY_CHANGE,
}; };
}; }
export const changeComposeLanguage = language => ({ export const changeComposeLanguage = language => ({
type: COMPOSE_LANGUAGE_CHANGE, type: COMPOSE_LANGUAGE_CHANGE,
@ -675,21 +675,21 @@ export function changeComposeSpoilerness() {
return { return {
type: COMPOSE_SPOILERNESS_CHANGE, type: COMPOSE_SPOILERNESS_CHANGE,
}; };
}; }
export function changeComposeSpoilerText(text) { export function changeComposeSpoilerText(text) {
return { return {
type: COMPOSE_SPOILER_TEXT_CHANGE, type: COMPOSE_SPOILER_TEXT_CHANGE,
text, text,
}; };
}; }
export function changeComposeVisibility(value) { export function changeComposeVisibility(value) {
return { return {
type: COMPOSE_VISIBILITY_CHANGE, type: COMPOSE_VISIBILITY_CHANGE,
value, value,
}; };
}; }
export function insertEmojiCompose(position, emoji, needsSpace) { export function insertEmojiCompose(position, emoji, needsSpace) {
return { return {
@ -698,33 +698,33 @@ export function insertEmojiCompose(position, emoji, needsSpace) {
emoji, emoji,
needsSpace, needsSpace,
}; };
}; }
export function changeComposing(value) { export function changeComposing(value) {
return { return {
type: COMPOSE_COMPOSING_CHANGE, type: COMPOSE_COMPOSING_CHANGE,
value, value,
}; };
}; }
export function addPoll() { export function addPoll() {
return { return {
type: COMPOSE_POLL_ADD, type: COMPOSE_POLL_ADD,
}; };
}; }
export function removePoll() { export function removePoll() {
return { return {
type: COMPOSE_POLL_REMOVE, type: COMPOSE_POLL_REMOVE,
}; };
}; }
export function addPollOption(title) { export function addPollOption(title) {
return { return {
type: COMPOSE_POLL_OPTION_ADD, type: COMPOSE_POLL_OPTION_ADD,
title, title,
}; };
}; }
export function changePollOption(index, title) { export function changePollOption(index, title) {
return { return {
@ -732,14 +732,14 @@ export function changePollOption(index, title) {
index, index,
title, title,
}; };
}; }
export function removePollOption(index) { export function removePollOption(index) {
return { return {
type: COMPOSE_POLL_OPTION_REMOVE, type: COMPOSE_POLL_OPTION_REMOVE,
index, index,
}; };
}; }
export function changePollSettings(expiresIn, isMultiple) { export function changePollSettings(expiresIn, isMultiple) {
return { return {
@ -747,4 +747,4 @@ export function changePollSettings(expiresIn, isMultiple) {
expiresIn, expiresIn,
isMultiple, isMultiple,
}; };
}; }

View File

@ -14,14 +14,14 @@ export function fetchCustomEmojis() {
dispatch(fetchCustomEmojisFail(error)); dispatch(fetchCustomEmojisFail(error));
}); });
}; };
}; }
export function fetchCustomEmojisRequest() { export function fetchCustomEmojisRequest() {
return { return {
type: CUSTOM_EMOJIS_FETCH_REQUEST, type: CUSTOM_EMOJIS_FETCH_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchCustomEmojisSuccess(custom_emojis) { export function fetchCustomEmojisSuccess(custom_emojis) {
return { return {
@ -29,7 +29,7 @@ export function fetchCustomEmojisSuccess(custom_emojis) {
custom_emojis, custom_emojis,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchCustomEmojisFail(error) { export function fetchCustomEmojisFail(error) {
return { return {
@ -37,4 +37,4 @@ export function fetchCustomEmojisFail(error) {
error, error,
skipLoading: true, skipLoading: true,
}; };
}; }

View File

@ -29,14 +29,14 @@ export function blockDomain(domain) {
dispatch(blockDomainFail(domain, err)); dispatch(blockDomainFail(domain, err));
}); });
}; };
}; }
export function blockDomainRequest(domain) { export function blockDomainRequest(domain) {
return { return {
type: DOMAIN_BLOCK_REQUEST, type: DOMAIN_BLOCK_REQUEST,
domain, domain,
}; };
}; }
export function blockDomainSuccess(domain, accounts) { export function blockDomainSuccess(domain, accounts) {
return { return {
@ -44,7 +44,7 @@ export function blockDomainSuccess(domain, accounts) {
domain, domain,
accounts, accounts,
}; };
}; }
export function blockDomainFail(domain, error) { export function blockDomainFail(domain, error) {
return { return {
@ -52,7 +52,7 @@ export function blockDomainFail(domain, error) {
domain, domain,
error, error,
}; };
}; }
export function unblockDomain(domain) { export function unblockDomain(domain) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -66,14 +66,14 @@ export function unblockDomain(domain) {
dispatch(unblockDomainFail(domain, err)); dispatch(unblockDomainFail(domain, err));
}); });
}; };
}; }
export function unblockDomainRequest(domain) { export function unblockDomainRequest(domain) {
return { return {
type: DOMAIN_UNBLOCK_REQUEST, type: DOMAIN_UNBLOCK_REQUEST,
domain, domain,
}; };
}; }
export function unblockDomainSuccess(domain, accounts) { export function unblockDomainSuccess(domain, accounts) {
return { return {
@ -81,7 +81,7 @@ export function unblockDomainSuccess(domain, accounts) {
domain, domain,
accounts, accounts,
}; };
}; }
export function unblockDomainFail(domain, error) { export function unblockDomainFail(domain, error) {
return { return {
@ -89,7 +89,7 @@ export function unblockDomainFail(domain, error) {
domain, domain,
error, error,
}; };
}; }
export function fetchDomainBlocks() { export function fetchDomainBlocks() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -102,13 +102,13 @@ export function fetchDomainBlocks() {
dispatch(fetchDomainBlocksFail(err)); dispatch(fetchDomainBlocksFail(err));
}); });
}; };
}; }
export function fetchDomainBlocksRequest() { export function fetchDomainBlocksRequest() {
return { return {
type: DOMAIN_BLOCKS_FETCH_REQUEST, type: DOMAIN_BLOCKS_FETCH_REQUEST,
}; };
}; }
export function fetchDomainBlocksSuccess(domains, next) { export function fetchDomainBlocksSuccess(domains, next) {
return { return {
@ -116,14 +116,14 @@ export function fetchDomainBlocksSuccess(domains, next) {
domains, domains,
next, next,
}; };
}; }
export function fetchDomainBlocksFail(error) { export function fetchDomainBlocksFail(error) {
return { return {
type: DOMAIN_BLOCKS_FETCH_FAIL, type: DOMAIN_BLOCKS_FETCH_FAIL,
error, error,
}; };
}; }
export function expandDomainBlocks() { export function expandDomainBlocks() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -142,13 +142,13 @@ export function expandDomainBlocks() {
dispatch(expandDomainBlocksFail(err)); dispatch(expandDomainBlocksFail(err));
}); });
}; };
}; }
export function expandDomainBlocksRequest() { export function expandDomainBlocksRequest() {
return { return {
type: DOMAIN_BLOCKS_EXPAND_REQUEST, type: DOMAIN_BLOCKS_EXPAND_REQUEST,
}; };
}; }
export function expandDomainBlocksSuccess(domains, next) { export function expandDomainBlocksSuccess(domains, next) {
return { return {
@ -156,11 +156,11 @@ export function expandDomainBlocksSuccess(domains, next) {
domains, domains,
next, next,
}; };
}; }
export function expandDomainBlocksFail(error) { export function expandDomainBlocksFail(error) {
return { return {
type: DOMAIN_BLOCKS_EXPAND_FAIL, type: DOMAIN_BLOCKS_EXPAND_FAIL,
error, error,
}; };
}; }

View File

@ -11,4 +11,4 @@ export function useEmoji(emoji) {
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }

View File

@ -25,14 +25,14 @@ export function fetchFavouritedStatuses() {
dispatch(fetchFavouritedStatusesFail(error)); dispatch(fetchFavouritedStatusesFail(error));
}); });
}; };
}; }
export function fetchFavouritedStatusesRequest() { export function fetchFavouritedStatusesRequest() {
return { return {
type: FAVOURITED_STATUSES_FETCH_REQUEST, type: FAVOURITED_STATUSES_FETCH_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchFavouritedStatusesSuccess(statuses, next) { export function fetchFavouritedStatusesSuccess(statuses, next) {
return { return {
@ -41,7 +41,7 @@ export function fetchFavouritedStatusesSuccess(statuses, next) {
next, next,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchFavouritedStatusesFail(error) { export function fetchFavouritedStatusesFail(error) {
return { return {
@ -49,7 +49,7 @@ export function fetchFavouritedStatusesFail(error) {
error, error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function expandFavouritedStatuses() { export function expandFavouritedStatuses() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -69,13 +69,13 @@ export function expandFavouritedStatuses() {
dispatch(expandFavouritedStatusesFail(error)); dispatch(expandFavouritedStatusesFail(error));
}); });
}; };
}; }
export function expandFavouritedStatusesRequest() { export function expandFavouritedStatusesRequest() {
return { return {
type: FAVOURITED_STATUSES_EXPAND_REQUEST, type: FAVOURITED_STATUSES_EXPAND_REQUEST,
}; };
}; }
export function expandFavouritedStatusesSuccess(statuses, next) { export function expandFavouritedStatusesSuccess(statuses, next) {
return { return {
@ -83,11 +83,11 @@ export function expandFavouritedStatusesSuccess(statuses, next) {
statuses, statuses,
next, next,
}; };
}; }
export function expandFavouritedStatusesFail(error) { export function expandFavouritedStatusesFail(error) {
return { return {
type: FAVOURITED_STATUSES_EXPAND_FAIL, type: FAVOURITED_STATUSES_EXPAND_FAIL,
error, error,
}; };
}; }

View File

@ -8,10 +8,10 @@ export function setHeight (key, id, height) {
id, id,
height, height,
}; };
}; }
export function clearHeight () { export function clearHeight () {
return { return {
type: HEIGHT_CACHE_CLEAR, type: HEIGHT_CACHE_CLEAR,
}; };
}; }

View File

@ -54,7 +54,7 @@ export function reblog(status, visibility) {
dispatch(reblogFail(status, error)); dispatch(reblogFail(status, error));
}); });
}; };
}; }
export function unreblog(status) { export function unreblog(status) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -67,7 +67,7 @@ export function unreblog(status) {
dispatch(unreblogFail(status, error)); dispatch(unreblogFail(status, error));
}); });
}; };
}; }
export function reblogRequest(status) { export function reblogRequest(status) {
return { return {
@ -75,7 +75,7 @@ export function reblogRequest(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function reblogSuccess(status) { export function reblogSuccess(status) {
return { return {
@ -83,7 +83,7 @@ export function reblogSuccess(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function reblogFail(status, error) { export function reblogFail(status, error) {
return { return {
@ -92,7 +92,7 @@ export function reblogFail(status, error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unreblogRequest(status) { export function unreblogRequest(status) {
return { return {
@ -100,7 +100,7 @@ export function unreblogRequest(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unreblogSuccess(status) { export function unreblogSuccess(status) {
return { return {
@ -108,7 +108,7 @@ export function unreblogSuccess(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unreblogFail(status, error) { export function unreblogFail(status, error) {
return { return {
@ -117,7 +117,7 @@ export function unreblogFail(status, error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function favourite(status) { export function favourite(status) {
return function (dispatch, getState) { return function (dispatch, getState) {
@ -130,7 +130,7 @@ export function favourite(status) {
dispatch(favouriteFail(status, error)); dispatch(favouriteFail(status, error));
}); });
}; };
}; }
export function unfavourite(status) { export function unfavourite(status) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -143,7 +143,7 @@ export function unfavourite(status) {
dispatch(unfavouriteFail(status, error)); dispatch(unfavouriteFail(status, error));
}); });
}; };
}; }
export function favouriteRequest(status) { export function favouriteRequest(status) {
return { return {
@ -151,7 +151,7 @@ export function favouriteRequest(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function favouriteSuccess(status) { export function favouriteSuccess(status) {
return { return {
@ -159,7 +159,7 @@ export function favouriteSuccess(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function favouriteFail(status, error) { export function favouriteFail(status, error) {
return { return {
@ -168,7 +168,7 @@ export function favouriteFail(status, error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfavouriteRequest(status) { export function unfavouriteRequest(status) {
return { return {
@ -176,7 +176,7 @@ export function unfavouriteRequest(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfavouriteSuccess(status) { export function unfavouriteSuccess(status) {
return { return {
@ -184,7 +184,7 @@ export function unfavouriteSuccess(status) {
status: status, status: status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unfavouriteFail(status, error) { export function unfavouriteFail(status, error) {
return { return {
@ -193,7 +193,7 @@ export function unfavouriteFail(status, error) {
error: error, error: error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function bookmark(status) { export function bookmark(status) {
return function (dispatch, getState) { return function (dispatch, getState) {
@ -206,7 +206,7 @@ export function bookmark(status) {
dispatch(bookmarkFail(status, error)); dispatch(bookmarkFail(status, error));
}); });
}; };
}; }
export function unbookmark(status) { export function unbookmark(status) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -219,14 +219,14 @@ export function unbookmark(status) {
dispatch(unbookmarkFail(status, error)); dispatch(unbookmarkFail(status, error));
}); });
}; };
}; }
export function bookmarkRequest(status) { export function bookmarkRequest(status) {
return { return {
type: BOOKMARK_REQUEST, type: BOOKMARK_REQUEST,
status: status, status: status,
}; };
}; }
export function bookmarkSuccess(status, response) { export function bookmarkSuccess(status, response) {
return { return {
@ -234,7 +234,7 @@ export function bookmarkSuccess(status, response) {
status: status, status: status,
response: response, response: response,
}; };
}; }
export function bookmarkFail(status, error) { export function bookmarkFail(status, error) {
return { return {
@ -242,14 +242,14 @@ export function bookmarkFail(status, error) {
status: status, status: status,
error: error, error: error,
}; };
}; }
export function unbookmarkRequest(status) { export function unbookmarkRequest(status) {
return { return {
type: UNBOOKMARK_REQUEST, type: UNBOOKMARK_REQUEST,
status: status, status: status,
}; };
}; }
export function unbookmarkSuccess(status, response) { export function unbookmarkSuccess(status, response) {
return { return {
@ -257,7 +257,7 @@ export function unbookmarkSuccess(status, response) {
status: status, status: status,
response: response, response: response,
}; };
}; }
export function unbookmarkFail(status, error) { export function unbookmarkFail(status, error) {
return { return {
@ -265,7 +265,7 @@ export function unbookmarkFail(status, error) {
status: status, status: status,
error: error, error: error,
}; };
}; }
export function fetchReblogs(id) { export function fetchReblogs(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -278,14 +278,14 @@ export function fetchReblogs(id) {
dispatch(fetchReblogsFail(id, error)); dispatch(fetchReblogsFail(id, error));
}); });
}; };
}; }
export function fetchReblogsRequest(id) { export function fetchReblogsRequest(id) {
return { return {
type: REBLOGS_FETCH_REQUEST, type: REBLOGS_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchReblogsSuccess(id, accounts) { export function fetchReblogsSuccess(id, accounts) {
return { return {
@ -293,14 +293,14 @@ export function fetchReblogsSuccess(id, accounts) {
id, id,
accounts, accounts,
}; };
}; }
export function fetchReblogsFail(id, error) { export function fetchReblogsFail(id, error) {
return { return {
type: REBLOGS_FETCH_FAIL, type: REBLOGS_FETCH_FAIL,
error, error,
}; };
}; }
export function fetchFavourites(id) { export function fetchFavourites(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -313,14 +313,14 @@ export function fetchFavourites(id) {
dispatch(fetchFavouritesFail(id, error)); dispatch(fetchFavouritesFail(id, error));
}); });
}; };
}; }
export function fetchFavouritesRequest(id) { export function fetchFavouritesRequest(id) {
return { return {
type: FAVOURITES_FETCH_REQUEST, type: FAVOURITES_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchFavouritesSuccess(id, accounts) { export function fetchFavouritesSuccess(id, accounts) {
return { return {
@ -328,14 +328,14 @@ export function fetchFavouritesSuccess(id, accounts) {
id, id,
accounts, accounts,
}; };
}; }
export function fetchFavouritesFail(id, error) { export function fetchFavouritesFail(id, error) {
return { return {
type: FAVOURITES_FETCH_FAIL, type: FAVOURITES_FETCH_FAIL,
error, error,
}; };
}; }
export function pin(status) { export function pin(status) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -348,7 +348,7 @@ export function pin(status) {
dispatch(pinFail(status, error)); dispatch(pinFail(status, error));
}); });
}; };
}; }
export function pinRequest(status) { export function pinRequest(status) {
return { return {
@ -356,7 +356,7 @@ export function pinRequest(status) {
status, status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function pinSuccess(status) { export function pinSuccess(status) {
return { return {
@ -364,7 +364,7 @@ export function pinSuccess(status) {
status, status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function pinFail(status, error) { export function pinFail(status, error) {
return { return {
@ -373,7 +373,7 @@ export function pinFail(status, error) {
error, error,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unpin (status) { export function unpin (status) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -386,7 +386,7 @@ export function unpin (status) {
dispatch(unpinFail(status, error)); dispatch(unpinFail(status, error));
}); });
}; };
}; }
export function unpinRequest(status) { export function unpinRequest(status) {
return { return {
@ -394,7 +394,7 @@ export function unpinRequest(status) {
status, status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unpinSuccess(status) { export function unpinSuccess(status) {
return { return {
@ -402,7 +402,7 @@ export function unpinSuccess(status) {
status, status,
skipLoading: true, skipLoading: true,
}; };
}; }
export function unpinFail(status, error) { export function unpinFail(status, error) {
return { return {
@ -411,4 +411,4 @@ export function unpinFail(status, error) {
error, error,
skipLoading: true, skipLoading: true,
}; };
}; }

View File

@ -101,7 +101,7 @@ export function submitMarkersSuccess({ home, notifications }) {
home: (home || {}).last_read_id, home: (home || {}).last_read_id,
notifications: (notifications || {}).last_read_id, notifications: (notifications || {}).last_read_id,
}; };
}; }
export function submitMarkers(params = {}) { export function submitMarkers(params = {}) {
const result = (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState); const result = (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState);
@ -111,7 +111,7 @@ export function submitMarkers(params = {}) {
} }
return result; return result;
}; }
export const fetchMarkers = () => (dispatch, getState) => { export const fetchMarkers = () => (dispatch, getState) => {
const params = { timeline: ['notifications'] }; const params = { timeline: ['notifications'] };
@ -130,7 +130,7 @@ export function fetchMarkersRequest() {
type: MARKERS_FETCH_REQUEST, type: MARKERS_FETCH_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchMarkersSuccess(markers) { export function fetchMarkersSuccess(markers) {
return { return {
@ -138,7 +138,7 @@ export function fetchMarkersSuccess(markers) {
markers, markers,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchMarkersFail(error) { export function fetchMarkersFail(error) {
return { return {
@ -147,4 +147,4 @@ export function fetchMarkersFail(error) {
skipLoading: true, skipLoading: true,
skipAlert: true, skipAlert: true,
}; };
}; }

View File

@ -7,7 +7,7 @@ export function openModal(type, props) {
modalType: type, modalType: type,
modalProps: props, modalProps: props,
}; };
}; }
export function closeModal(type, options = { ignoreFocus: false }) { export function closeModal(type, options = { ignoreFocus: false }) {
return { return {
@ -15,4 +15,4 @@ export function closeModal(type, options = { ignoreFocus: false }) {
modalType: type, modalType: type,
ignoreFocus: options.ignoreFocus, ignoreFocus: options.ignoreFocus,
}; };
}; }

View File

@ -26,13 +26,13 @@ export function fetchMutes() {
dispatch(fetchRelationships(response.data.map(item => item.id))); dispatch(fetchRelationships(response.data.map(item => item.id)));
}).catch(error => dispatch(fetchMutesFail(error))); }).catch(error => dispatch(fetchMutesFail(error)));
}; };
}; }
export function fetchMutesRequest() { export function fetchMutesRequest() {
return { return {
type: MUTES_FETCH_REQUEST, type: MUTES_FETCH_REQUEST,
}; };
}; }
export function fetchMutesSuccess(accounts, next) { export function fetchMutesSuccess(accounts, next) {
return { return {
@ -40,14 +40,14 @@ export function fetchMutesSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function fetchMutesFail(error) { export function fetchMutesFail(error) {
return { return {
type: MUTES_FETCH_FAIL, type: MUTES_FETCH_FAIL,
error, error,
}; };
}; }
export function expandMutes() { export function expandMutes() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -66,13 +66,13 @@ export function expandMutes() {
dispatch(fetchRelationships(response.data.map(item => item.id))); dispatch(fetchRelationships(response.data.map(item => item.id)));
}).catch(error => dispatch(expandMutesFail(error))); }).catch(error => dispatch(expandMutesFail(error)));
}; };
}; }
export function expandMutesRequest() { export function expandMutesRequest() {
return { return {
type: MUTES_EXPAND_REQUEST, type: MUTES_EXPAND_REQUEST,
}; };
}; }
export function expandMutesSuccess(accounts, next) { export function expandMutesSuccess(accounts, next) {
return { return {
@ -80,14 +80,14 @@ export function expandMutesSuccess(accounts, next) {
accounts, accounts,
next, next,
}; };
}; }
export function expandMutesFail(error) { export function expandMutesFail(error) {
return { return {
type: MUTES_EXPAND_FAIL, type: MUTES_EXPAND_FAIL,
error, error,
}; };
}; }
export function initMuteModal(account) { export function initMuteModal(account) {
return dispatch => { return dispatch => {

View File

@ -118,7 +118,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
}); });
} }
}; };
}; }
const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS();
@ -197,14 +197,14 @@ export function expandNotifications({ maxId, forceLoad } = {}, done = noOp) {
done(); done();
}); });
}; };
}; }
export function expandNotificationsRequest(isLoadingMore) { export function expandNotificationsRequest(isLoadingMore) {
return { return {
type: NOTIFICATIONS_EXPAND_REQUEST, type: NOTIFICATIONS_EXPAND_REQUEST,
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
}; };
}; }
export function expandNotificationsSuccess(notifications, next, isLoadingMore, isLoadingRecent, usePendingItems) { export function expandNotificationsSuccess(notifications, next, isLoadingMore, isLoadingRecent, usePendingItems) {
return { return {
@ -215,7 +215,7 @@ export function expandNotificationsSuccess(notifications, next, isLoadingMore, i
usePendingItems, usePendingItems,
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
}; };
}; }
export function expandNotificationsFail(error, isLoadingMore) { export function expandNotificationsFail(error, isLoadingMore) {
return { return {
@ -224,7 +224,7 @@ export function expandNotificationsFail(error, isLoadingMore) {
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
skipAlert: !isLoadingMore || error.name === 'AbortError', skipAlert: !isLoadingMore || error.name === 'AbortError',
}; };
}; }
export function clearNotifications() { export function clearNotifications() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -234,14 +234,14 @@ export function clearNotifications() {
api(getState).post('/api/v1/notifications/clear'); api(getState).post('/api/v1/notifications/clear');
}; };
}; }
export function scrollTopNotifications(top) { export function scrollTopNotifications(top) {
return { return {
type: NOTIFICATIONS_SCROLL_TOP, type: NOTIFICATIONS_SCROLL_TOP,
top, top,
}; };
}; }
export function setFilter (filterType) { export function setFilter (filterType) {
return dispatch => { return dispatch => {
@ -253,7 +253,7 @@ export function setFilter (filterType) {
dispatch(expandNotifications({ forceLoad: true })); dispatch(expandNotifications({ forceLoad: true }));
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }
export const mountNotifications = () => ({ export const mountNotifications = () => ({
type: NOTIFICATIONS_MOUNT, type: NOTIFICATIONS_MOUNT,
@ -291,7 +291,7 @@ export function requestBrowserPermission(callback = noOp) {
callback(permission); callback(permission);
}); });
}; };
}; }
export function setBrowserSupport (value) { export function setBrowserSupport (value) {
return { return {

View File

@ -18,13 +18,13 @@ export function fetchPinnedStatuses() {
dispatch(fetchPinnedStatusesFail(error)); dispatch(fetchPinnedStatusesFail(error));
}); });
}; };
}; }
export function fetchPinnedStatusesRequest() { export function fetchPinnedStatusesRequest() {
return { return {
type: PINNED_STATUSES_FETCH_REQUEST, type: PINNED_STATUSES_FETCH_REQUEST,
}; };
}; }
export function fetchPinnedStatusesSuccess(statuses, next) { export function fetchPinnedStatusesSuccess(statuses, next) {
return { return {
@ -32,11 +32,11 @@ export function fetchPinnedStatusesSuccess(statuses, next) {
statuses, statuses,
next, next,
}; };
}; }
export function fetchPinnedStatusesFail(error) { export function fetchPinnedStatusesFail(error) {
return { return {
type: PINNED_STATUSES_FETCH_FAIL, type: PINNED_STATUSES_FETCH_FAIL,
error, error,
}; };
}; }

View File

@ -19,13 +19,13 @@ export function changeSearch(value) {
type: SEARCH_CHANGE, type: SEARCH_CHANGE,
value, value,
}; };
}; }
export function clearSearch() { export function clearSearch() {
return { return {
type: SEARCH_CLEAR, type: SEARCH_CLEAR,
}; };
}; }
export function submitSearch() { export function submitSearch() {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -60,13 +60,13 @@ export function submitSearch() {
dispatch(fetchSearchFail(error)); dispatch(fetchSearchFail(error));
}); });
}; };
}; }
export function fetchSearchRequest() { export function fetchSearchRequest() {
return { return {
type: SEARCH_FETCH_REQUEST, type: SEARCH_FETCH_REQUEST,
}; };
}; }
export function fetchSearchSuccess(results, searchTerm) { export function fetchSearchSuccess(results, searchTerm) {
return { return {
@ -74,14 +74,14 @@ export function fetchSearchSuccess(results, searchTerm) {
results, results,
searchTerm, searchTerm,
}; };
}; }
export function fetchSearchFail(error) { export function fetchSearchFail(error) {
return { return {
type: SEARCH_FETCH_FAIL, type: SEARCH_FETCH_FAIL,
error, error,
}; };
}; }
export const expandSearch = type => (dispatch, getState) => { export const expandSearch = type => (dispatch, getState) => {
const value = getState().getIn(['search', 'value']); const value = getState().getIn(['search', 'value']);

View File

@ -15,7 +15,7 @@ export function changeSetting(path, value) {
dispatch(saveSettings()); dispatch(saveSettings());
}; };
}; }
const debouncedSave = debounce((dispatch, getState) => { const debouncedSave = debounce((dispatch, getState) => {
if (getState().getIn(['settings', 'saved'])) { if (getState().getIn(['settings', 'saved'])) {
@ -31,4 +31,4 @@ const debouncedSave = debounce((dispatch, getState) => {
export function saveSettings() { export function saveSettings() {
return (dispatch, getState) => debouncedSave(dispatch, getState); return (dispatch, getState) => debouncedSave(dispatch, getState);
}; }

View File

@ -45,7 +45,7 @@ export function fetchStatusRequest(id, skipLoading) {
id, id,
skipLoading, skipLoading,
}; };
}; }
export function fetchStatus(id, forceFetch = false) { export function fetchStatus(id, forceFetch = false) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -66,14 +66,14 @@ export function fetchStatus(id, forceFetch = false) {
dispatch(fetchStatusFail(id, error, skipLoading)); dispatch(fetchStatusFail(id, error, skipLoading));
}); });
}; };
}; }
export function fetchStatusSuccess(skipLoading) { export function fetchStatusSuccess(skipLoading) {
return { return {
type: STATUS_FETCH_SUCCESS, type: STATUS_FETCH_SUCCESS,
skipLoading, skipLoading,
}; };
}; }
export function fetchStatusFail(id, error, skipLoading) { export function fetchStatusFail(id, error, skipLoading) {
return { return {
@ -83,7 +83,7 @@ export function fetchStatusFail(id, error, skipLoading) {
skipLoading, skipLoading,
skipAlert: true, skipAlert: true,
}; };
}; }
export function redraft(status, raw_text) { export function redraft(status, raw_text) {
return { return {
@ -91,7 +91,7 @@ export function redraft(status, raw_text) {
status, status,
raw_text, raw_text,
}; };
}; }
export const editStatus = (id, routerHistory) => (dispatch, getState) => { export const editStatus = (id, routerHistory) => (dispatch, getState) => {
let status = getState().getIn(['statuses', id]); let status = getState().getIn(['statuses', id]);
@ -147,21 +147,21 @@ export function deleteStatus(id, routerHistory, withRedraft = false) {
dispatch(deleteStatusFail(id, error)); dispatch(deleteStatusFail(id, error));
}); });
}; };
}; }
export function deleteStatusRequest(id) { export function deleteStatusRequest(id) {
return { return {
type: STATUS_DELETE_REQUEST, type: STATUS_DELETE_REQUEST,
id: id, id: id,
}; };
}; }
export function deleteStatusSuccess(id) { export function deleteStatusSuccess(id) {
return { return {
type: STATUS_DELETE_SUCCESS, type: STATUS_DELETE_SUCCESS,
id: id, id: id,
}; };
}; }
export function deleteStatusFail(id, error) { export function deleteStatusFail(id, error) {
return { return {
@ -169,7 +169,7 @@ export function deleteStatusFail(id, error) {
id: id, id: id,
error: error, error: error,
}; };
}; }
export const updateStatus = status => dispatch => export const updateStatus = status => dispatch =>
dispatch(importFetchedStatus(status)); dispatch(importFetchedStatus(status));
@ -190,14 +190,14 @@ export function fetchContext(id) {
dispatch(fetchContextFail(id, error)); dispatch(fetchContextFail(id, error));
}); });
}; };
}; }
export function fetchContextRequest(id) { export function fetchContextRequest(id) {
return { return {
type: CONTEXT_FETCH_REQUEST, type: CONTEXT_FETCH_REQUEST,
id, id,
}; };
}; }
export function fetchContextSuccess(id, ancestors, descendants) { export function fetchContextSuccess(id, ancestors, descendants) {
return { return {
@ -207,7 +207,7 @@ export function fetchContextSuccess(id, ancestors, descendants) {
descendants, descendants,
statuses: ancestors.concat(descendants), statuses: ancestors.concat(descendants),
}; };
}; }
export function fetchContextFail(id, error) { export function fetchContextFail(id, error) {
return { return {
@ -216,7 +216,7 @@ export function fetchContextFail(id, error) {
error, error,
skipAlert: true, skipAlert: true,
}; };
}; }
export function muteStatus(id) { export function muteStatus(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -228,21 +228,21 @@ export function muteStatus(id) {
dispatch(muteStatusFail(id, error)); dispatch(muteStatusFail(id, error));
}); });
}; };
}; }
export function muteStatusRequest(id) { export function muteStatusRequest(id) {
return { return {
type: STATUS_MUTE_REQUEST, type: STATUS_MUTE_REQUEST,
id, id,
}; };
}; }
export function muteStatusSuccess(id) { export function muteStatusSuccess(id) {
return { return {
type: STATUS_MUTE_SUCCESS, type: STATUS_MUTE_SUCCESS,
id, id,
}; };
}; }
export function muteStatusFail(id, error) { export function muteStatusFail(id, error) {
return { return {
@ -250,7 +250,7 @@ export function muteStatusFail(id, error) {
id, id,
error, error,
}; };
}; }
export function unmuteStatus(id) { export function unmuteStatus(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -262,21 +262,21 @@ export function unmuteStatus(id) {
dispatch(unmuteStatusFail(id, error)); dispatch(unmuteStatusFail(id, error));
}); });
}; };
}; }
export function unmuteStatusRequest(id) { export function unmuteStatusRequest(id) {
return { return {
type: STATUS_UNMUTE_REQUEST, type: STATUS_UNMUTE_REQUEST,
id, id,
}; };
}; }
export function unmuteStatusSuccess(id) { export function unmuteStatusSuccess(id) {
return { return {
type: STATUS_UNMUTE_SUCCESS, type: STATUS_UNMUTE_SUCCESS,
id, id,
}; };
}; }
export function unmuteStatusFail(id, error) { export function unmuteStatusFail(id, error) {
return { return {
@ -284,7 +284,7 @@ export function unmuteStatusFail(id, error) {
id, id,
error, error,
}; };
}; }
export function hideStatus(ids) { export function hideStatus(ids) {
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
@ -295,7 +295,7 @@ export function hideStatus(ids) {
type: STATUS_HIDE, type: STATUS_HIDE,
ids, ids,
}; };
}; }
export function revealStatus(ids) { export function revealStatus(ids) {
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
@ -306,7 +306,7 @@ export function revealStatus(ids) {
type: STATUS_REVEAL, type: STATUS_REVEAL,
ids, ids,
}; };
}; }
export function toggleStatusCollapse(id, isCollapsed) { export function toggleStatusCollapse(id, isCollapsed) {
return { return {
@ -314,7 +314,7 @@ export function toggleStatusCollapse(id, isCollapsed) {
id, id,
isCollapsed, isCollapsed,
}; };
}; }
export const translateStatus = id => (dispatch, getState) => { export const translateStatus = id => (dispatch, getState) => {
dispatch(translateStatusRequest(id)); dispatch(translateStatusRequest(id));

View File

@ -21,4 +21,4 @@ export function hydrateStore(rawState) {
dispatch(hydrateCompose()); dispatch(hydrateCompose());
dispatch(importFetchedAccounts(Object.values(rawState.accounts))); dispatch(importFetchedAccounts(Object.values(rawState.accounts)));
}; };
}; }

View File

@ -21,14 +21,14 @@ export function fetchSuggestions(withRelationships = false) {
} }
}).catch(error => dispatch(fetchSuggestionsFail(error))); }).catch(error => dispatch(fetchSuggestionsFail(error)));
}; };
}; }
export function fetchSuggestionsRequest() { export function fetchSuggestionsRequest() {
return { return {
type: SUGGESTIONS_FETCH_REQUEST, type: SUGGESTIONS_FETCH_REQUEST,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchSuggestionsSuccess(suggestions) { export function fetchSuggestionsSuccess(suggestions) {
return { return {
@ -36,7 +36,7 @@ export function fetchSuggestionsSuccess(suggestions) {
suggestions, suggestions,
skipLoading: true, skipLoading: true,
}; };
}; }
export function fetchSuggestionsFail(error) { export function fetchSuggestionsFail(error) {
return { return {
@ -45,7 +45,7 @@ export function fetchSuggestionsFail(error) {
skipLoading: true, skipLoading: true,
skipAlert: true, skipAlert: true,
}; };
}; }
export const dismissSuggestion = accountId => (dispatch, getState) => { export const dismissSuggestion = accountId => (dispatch, getState) => {
dispatch({ dispatch({

View File

@ -51,7 +51,7 @@ export function updateTimeline(timeline, status, accept) {
dispatch(submitMarkers()); dispatch(submitMarkers());
} }
}; };
}; }
export function deleteFromTimelines(id) { export function deleteFromTimelines(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -67,13 +67,13 @@ export function deleteFromTimelines(id) {
reblogOf, reblogOf,
}); });
}; };
}; }
export function clearTimeline(timeline) { export function clearTimeline(timeline) {
return (dispatch) => { return (dispatch) => {
dispatch({ type: TIMELINE_CLEAR, timeline }); dispatch({ type: TIMELINE_CLEAR, timeline });
}; };
}; }
const noOp = () => {}; const noOp = () => {};
@ -122,7 +122,7 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) {
done(); done();
}); });
}; };
}; }
export function fillTimelineGaps(timelineId, path, params = {}, done = noOp) { export function fillTimelineGaps(timelineId, path, params = {}, done = noOp) {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -168,7 +168,7 @@ export function expandTimelineRequest(timeline, isLoadingMore) {
timeline, timeline,
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
}; };
}; }
export function expandTimelineSuccess(timeline, statuses, next, partial, isLoadingRecent, isLoadingMore, usePendingItems) { export function expandTimelineSuccess(timeline, statuses, next, partial, isLoadingRecent, isLoadingMore, usePendingItems) {
return { return {
@ -181,7 +181,7 @@ export function expandTimelineSuccess(timeline, statuses, next, partial, isLoadi
usePendingItems, usePendingItems,
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
}; };
}; }
export function expandTimelineFail(timeline, error, isLoadingMore) { export function expandTimelineFail(timeline, error, isLoadingMore) {
return { return {
@ -191,7 +191,7 @@ export function expandTimelineFail(timeline, error, isLoadingMore) {
skipLoading: !isLoadingMore, skipLoading: !isLoadingMore,
skipNotFound: timeline.startsWith('account:'), skipNotFound: timeline.startsWith('account:'),
}; };
}; }
export function scrollTopTimeline(timeline, top) { export function scrollTopTimeline(timeline, top) {
return { return {
@ -199,7 +199,7 @@ export function scrollTopTimeline(timeline, top) {
timeline, timeline,
top, top,
}; };
}; }
export function connectTimeline(timeline) { export function connectTimeline(timeline) {
return { return {
@ -207,7 +207,7 @@ export function connectTimeline(timeline) {
timeline, timeline,
usePendingItems: preferPendingItems, usePendingItems: preferPendingItems,
}; };
}; }
export const disconnectTimeline = timeline => ({ export const disconnectTimeline = timeline => ({
type: TIMELINE_DISCONNECT, type: TIMELINE_DISCONNECT,

View File

@ -9,4 +9,4 @@ export function start() {
} catch (e) { } catch (e) {
// If called twice // If called twice
} }
}; }

View File

@ -8,4 +8,4 @@ export default function compareId (id1, id2) {
} else { } else {
return id1.length > id2.length ? 1 : -1; return id1.length > id2.length ? 1 : -1;
} }
}; }

View File

@ -137,7 +137,7 @@ export default class Retention extends React.PureComponent {
break; break;
default: default:
title = <FormattedMessage id='admin.dashboard.monthly_retention' defaultMessage='User retention rate by month after sign-up' />; title = <FormattedMessage id='admin.dashboard.monthly_retention' defaultMessage='User retention rate by month after sign-up' />;
}; }
return ( return (
<div className='retention'> <div className='retention'>

View File

@ -72,4 +72,4 @@ class ClosedRegistrationsModal extends ImmutablePureComponent {
); );
} }
}; }

View File

@ -6,4 +6,4 @@ export function countableText(inputText) {
return inputText return inputText
.replace(urlRegex, urlPlaceholder) .replace(urlRegex, urlPlaceholder)
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3'); .replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
}; }

View File

@ -38,7 +38,7 @@ class ColumnSettings extends React.PureComponent {
} else { } else {
return tags; return tags;
} }
}; }
onSelect = mode => value => { onSelect = mode => value => {
const oldValue = this.tags(mode); const oldValue = this.tags(mode);
@ -98,7 +98,7 @@ class ColumnSettings extends React.PureComponent {
default: default:
return ''; return '';
} }
}; }
render () { render () {
const { settings, onChange } = this.props; const { settings, onChange } = this.props;

View File

@ -126,7 +126,7 @@ class ListTimeline extends React.PureComponent {
onConfirm: () => { onConfirm: () => {
dispatch(deleteList(id)); dispatch(deleteList(id));
if (!!columnId) { if (columnId) {
dispatch(removeColumn(columnId)); dispatch(removeColumn(columnId));
} else { } else {
this.context.router.history.push('/lists'); this.context.router.history.push('/lists');

View File

@ -89,4 +89,4 @@ class DisabledAccountBanner extends React.PureComponent {
); );
} }
}; }

View File

@ -91,4 +91,4 @@ class LinkFooter extends React.PureComponent {
); );
} }
}; }

View File

@ -46,7 +46,7 @@ export class WrappedRoute extends React.Component {
return { return {
hasError: true, hasError: true,
}; };
}; }
state = { state = {
hasError: false, hasError: false,

View File

@ -14,4 +14,4 @@ export default function errorsMiddleware() {
return next(action); return next(action);
}; };
}; }

View File

@ -22,4 +22,4 @@ export default function loadingBarMiddleware(config = {}) {
return next(action); return next(action);
}; };
}; }

View File

@ -43,4 +43,4 @@ export default function soundsMiddleware() {
return next(action); return next(action);
}; };
}; }

View File

@ -35,4 +35,4 @@ export default function accounts(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -35,4 +35,4 @@ export default function accountsCounters(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -17,4 +17,4 @@ export default function accountsMap(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -23,4 +23,4 @@ export default function alerts(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -99,4 +99,4 @@ export default function announcementsReducer(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -108,7 +108,7 @@ function statusToTextMentions(state, status) {
} }
return set.union(status.get('mentions').filterNot(mention => mention.get('id') === me).map(mention => `@${mention.get('acct')} `)).join(''); return set.union(status.get('mentions').filterNot(mention => mention.get('id') === me).map(mention => `@${mention.get('acct')} `)).join('');
}; }
function clearAll(state) { function clearAll(state) {
return state.withMutations(map => { return state.withMutations(map => {
@ -126,7 +126,7 @@ function clearAll(state) {
map.set('poll', null); map.set('poll', null);
map.set('idempotencyKey', uuid()); map.set('idempotencyKey', uuid());
}); });
}; }
function appendMedia(state, media, file) { function appendMedia(state, media, file) {
const prevSize = state.get('media_attachments').size; const prevSize = state.get('media_attachments').size;
@ -146,7 +146,7 @@ function appendMedia(state, media, file) {
map.set('sensitive', true); map.set('sensitive', true);
} }
}); });
}; }
function removeMedia(state, mediaId) { function removeMedia(state, mediaId) {
const prevSize = state.get('media_attachments').size; const prevSize = state.get('media_attachments').size;
@ -159,7 +159,7 @@ function removeMedia(state, mediaId) {
map.set('sensitive', false); map.set('sensitive', false);
} }
}); });
}; }
const insertSuggestion = (state, position, token, completion, path) => { const insertSuggestion = (state, position, token, completion, path) => {
return state.withMutations(map => { return state.withMutations(map => {
@ -524,4 +524,4 @@ export default function compose(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -103,4 +103,4 @@ export default function replies(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -113,4 +113,4 @@ export default function conversations(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -12,4 +12,4 @@ export default function custom_emojis(state = initialState, action) {
} }
return state; return state;
}; }

View File

@ -22,4 +22,4 @@ export default function domainLists(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -41,4 +41,4 @@ export default function filters(state = ImmutableMap(), action) {
default: default:
return state; return state;
} }
}; }

View File

@ -20,4 +20,4 @@ export default function statuses(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -44,4 +44,4 @@ export default function listAdderReducer(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -93,4 +93,4 @@ export default function listEditorReducer(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -34,4 +34,4 @@ export default function lists(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -22,4 +22,4 @@ export default function markers(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -12,4 +12,4 @@ export default function meta(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -19,4 +19,4 @@ export default function meta(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -18,4 +18,4 @@ export default function missed_updates(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -36,4 +36,4 @@ export default function modal(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -303,4 +303,4 @@ export default function notifications(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -22,4 +22,4 @@ export default function pictureInPicture(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -50,4 +50,4 @@ export default function push_subscriptions(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -82,4 +82,4 @@ export default function relationships(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -64,4 +64,4 @@ export default function search(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -171,4 +171,4 @@ export default function settings(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -145,4 +145,4 @@ export default function statusLists(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -92,4 +92,4 @@ export default function statuses(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -34,4 +34,4 @@ export default function suggestionsReducer(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -22,4 +22,4 @@ export default function tags(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -223,4 +223,4 @@ export default function timelines(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -43,4 +43,4 @@ export default function trendsReducer(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -187,4 +187,4 @@ export default function userLists(state = initialState, action) {
default: default:
return state; return state;
} }
}; }

View File

@ -12,4 +12,4 @@ export default function configureStore() {
errorsMiddleware(), errorsMiddleware(),
soundsMiddleware(), soundsMiddleware(),
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f)); ), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
}; }

View File

@ -1,3 +1,3 @@
export default function uuid(a) { export default function uuid(a) {
return a ? (a^Math.random() * 16 >> a / 4).toString(16) : ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, uuid); return a ? (a^Math.random() * 16 >> a / 4).toString(16) : ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, uuid);
}; }

View File

@ -717,7 +717,7 @@ const startWorker = async (workerId) => {
Object.keys(req.cachedFilters).forEach((key) => { Object.keys(req.cachedFilters).forEach((key) => {
req.cachedFilters[key].regexp = new RegExp(req.cachedFilters[key].keywords.map(([keyword, whole_word]) => { req.cachedFilters[key].regexp = new RegExp(req.cachedFilters[key].keywords.map(([keyword, whole_word]) => {
let expr = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');; let expr = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
if (whole_word) { if (whole_word) {
if (/^[\w]/.test(expr)) { if (/^[\w]/.test(expr)) {