[Glitch] Run eslint --fix
I don't like it changing files this way, but it's basically what
c49213f0ea
and a few others did.
pull/53/head
parent
ed7cb79723
commit
155424e52f
|
@ -15,7 +15,7 @@ window.addEventListener('message', e => {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
height: document.getElementsByTagName('html')[0].scrollHeight,
|
height: document.getElementsByTagName('html')[0].scrollHeight,
|
||||||
}, '*');
|
}, '*');
|
||||||
};
|
}
|
||||||
|
|
||||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||||
setEmbedHeight();
|
setEmbedHeight();
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
import 'packs/public-path';
|
import 'packs/public-path';
|
||||||
import escapeTextContentForBrowser from 'escape-html';
|
import escapeTextContentForBrowser from 'escape-html';
|
||||||
|
|
||||||
const { delegate } = require('@rails/ujs');
|
const { delegate } = require('@rails/ujs');
|
||||||
|
|
||||||
import emojify from '../mastodon/features/emoji/emoji';
|
import emojify from '../mastodon/features/emoji/emoji';
|
||||||
|
|
||||||
delegate(document, '#account_display_name', 'input', ({ target }) => {
|
delegate(document, '#account_display_name', 'input', ({ target }) => {
|
||||||
|
|
|
@ -21,27 +21,27 @@ export function submitAccountNote() {
|
||||||
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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function initEditAccountNote(account) {
|
export function initEditAccountNote(account) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -53,17 +53,17 @@ export function initEditAccountNote(account) {
|
||||||
comment,
|
comment,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function cancelAccountNote() {
|
export function cancelAccountNote() {
|
||||||
return {
|
return {
|
||||||
type: ACCOUNT_NOTE_CANCEL,
|
type: ACCOUNT_NOTE_CANCEL,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function changeAccountNoteComment(comment) {
|
export function changeAccountNoteComment(comment) {
|
||||||
return {
|
return {
|
||||||
type: ACCOUNT_NOTE_CHANGE_COMMENT,
|
type: ACCOUNT_NOTE_CHANGE_COMMENT,
|
||||||
comment,
|
comment,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -108,7 +108,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));
|
||||||
|
@ -143,13 +143,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 {
|
||||||
|
@ -158,7 +158,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) => {
|
||||||
|
@ -173,7 +173,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) => {
|
||||||
|
@ -185,7 +185,7 @@ export function unfollowAccount(id) {
|
||||||
dispatch(unfollowAccountFail(error));
|
dispatch(unfollowAccountFail(error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function followAccountRequest(id, locked) {
|
export function followAccountRequest(id, locked) {
|
||||||
return {
|
return {
|
||||||
|
@ -194,7 +194,7 @@ export function followAccountRequest(id, locked) {
|
||||||
locked,
|
locked,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function followAccountSuccess(relationship, alreadyFollowing) {
|
export function followAccountSuccess(relationship, alreadyFollowing) {
|
||||||
return {
|
return {
|
||||||
|
@ -203,7 +203,7 @@ export function followAccountSuccess(relationship, alreadyFollowing) {
|
||||||
alreadyFollowing,
|
alreadyFollowing,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function followAccountFail(error, locked) {
|
export function followAccountFail(error, locked) {
|
||||||
return {
|
return {
|
||||||
|
@ -212,7 +212,7 @@ export function followAccountFail(error, locked) {
|
||||||
locked,
|
locked,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfollowAccountRequest(id) {
|
export function unfollowAccountRequest(id) {
|
||||||
return {
|
return {
|
||||||
|
@ -220,7 +220,7 @@ export function unfollowAccountRequest(id) {
|
||||||
id,
|
id,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfollowAccountSuccess(relationship, statuses) {
|
export function unfollowAccountSuccess(relationship, statuses) {
|
||||||
return {
|
return {
|
||||||
|
@ -229,7 +229,7 @@ export function unfollowAccountSuccess(relationship, statuses) {
|
||||||
statuses,
|
statuses,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfollowAccountFail(error) {
|
export function unfollowAccountFail(error) {
|
||||||
return {
|
return {
|
||||||
|
@ -237,7 +237,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) => {
|
||||||
|
@ -250,7 +250,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) => {
|
||||||
|
@ -262,14 +262,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 {
|
||||||
|
@ -277,35 +277,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) {
|
||||||
|
@ -319,7 +319,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) => {
|
||||||
|
@ -331,14 +331,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 {
|
||||||
|
@ -346,35 +346,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) {
|
||||||
|
@ -391,14 +391,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 {
|
||||||
|
@ -407,7 +407,7 @@ export function fetchFollowersSuccess(id, accounts, next) {
|
||||||
accounts,
|
accounts,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchFollowersFail(id, error) {
|
export function fetchFollowersFail(id, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -416,7 +416,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) => {
|
||||||
|
@ -438,14 +438,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 {
|
||||||
|
@ -454,7 +454,7 @@ export function expandFollowersSuccess(id, accounts, next) {
|
||||||
accounts,
|
accounts,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowersFail(id, error) {
|
export function expandFollowersFail(id, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -462,7 +462,7 @@ export function expandFollowersFail(id, error) {
|
||||||
id,
|
id,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchFollowing(id) {
|
export function fetchFollowing(id) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -478,14 +478,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 {
|
||||||
|
@ -494,7 +494,7 @@ export function fetchFollowingSuccess(id, accounts, next) {
|
||||||
accounts,
|
accounts,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchFollowingFail(id, error) {
|
export function fetchFollowingFail(id, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -503,7 +503,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) => {
|
||||||
|
@ -525,14 +525,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 {
|
||||||
|
@ -541,7 +541,7 @@ export function expandFollowingSuccess(id, accounts, next) {
|
||||||
accounts,
|
accounts,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowingFail(id, error) {
|
export function expandFollowingFail(id, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -549,7 +549,7 @@ export function expandFollowingFail(id, error) {
|
||||||
id,
|
id,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchRelationships(accountIds) {
|
export function fetchRelationships(accountIds) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -570,7 +570,7 @@ export function fetchRelationships(accountIds) {
|
||||||
dispatch(fetchRelationshipsFail(error));
|
dispatch(fetchRelationshipsFail(error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchRelationshipsRequest(ids) {
|
export function fetchRelationshipsRequest(ids) {
|
||||||
return {
|
return {
|
||||||
|
@ -578,7 +578,7 @@ export function fetchRelationshipsRequest(ids) {
|
||||||
ids,
|
ids,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchRelationshipsSuccess(relationships) {
|
export function fetchRelationshipsSuccess(relationships) {
|
||||||
return {
|
return {
|
||||||
|
@ -586,7 +586,7 @@ export function fetchRelationshipsSuccess(relationships) {
|
||||||
relationships,
|
relationships,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchRelationshipsFail(error) {
|
export function fetchRelationshipsFail(error) {
|
||||||
return {
|
return {
|
||||||
|
@ -595,7 +595,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) => {
|
||||||
|
@ -607,13 +607,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 {
|
||||||
|
@ -621,14 +621,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) => {
|
||||||
|
@ -646,13 +646,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 {
|
||||||
|
@ -660,14 +660,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) => {
|
||||||
|
@ -678,21 +678,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 {
|
||||||
|
@ -700,7 +700,7 @@ export function authorizeFollowRequestFail(id, error) {
|
||||||
id,
|
id,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
export function rejectFollowRequest(id) {
|
export function rejectFollowRequest(id) {
|
||||||
|
@ -712,21 +712,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 {
|
||||||
|
@ -734,7 +734,7 @@ export function rejectFollowRequestFail(id, error) {
|
||||||
id,
|
id,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function pinAccount(id) {
|
export function pinAccount(id) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -746,7 +746,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) => {
|
||||||
|
@ -758,49 +758,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,
|
||||||
|
@ -811,18 +811,18 @@ export function fetchPinnedAccounts() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
dispatch(fetchPinnedAccountsRequest());
|
dispatch(fetchPinnedAccountsRequest());
|
||||||
|
|
||||||
api(getState).get(`/api/v1/endorsements`, { params: { limit: 0 } }).then(response => {
|
api(getState).get('/api/v1/endorsements', { params: { limit: 0 } }).then(response => {
|
||||||
dispatch(importFetchedAccounts(response.data));
|
dispatch(importFetchedAccounts(response.data));
|
||||||
dispatch(fetchPinnedAccountsSuccess(response.data));
|
dispatch(fetchPinnedAccountsSuccess(response.data));
|
||||||
}).catch(err => dispatch(fetchPinnedAccountsFail(err)));
|
}).catch(err => dispatch(fetchPinnedAccountsFail(err)));
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchPinnedAccountsRequest() {
|
export function fetchPinnedAccountsRequest() {
|
||||||
return {
|
return {
|
||||||
type: PINNED_ACCOUNTS_FETCH_REQUEST,
|
type: PINNED_ACCOUNTS_FETCH_REQUEST,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchPinnedAccountsSuccess(accounts, next) {
|
export function fetchPinnedAccountsSuccess(accounts, next) {
|
||||||
return {
|
return {
|
||||||
|
@ -830,14 +830,14 @@ export function fetchPinnedAccountsSuccess(accounts, next) {
|
||||||
accounts,
|
accounts,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchPinnedAccountsFail(error) {
|
export function fetchPinnedAccountsFail(error) {
|
||||||
return {
|
return {
|
||||||
type: PINNED_ACCOUNTS_FETCH_FAIL,
|
type: PINNED_ACCOUNTS_FETCH_FAIL,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchPinnedAccountsSuggestions(q) {
|
export function fetchPinnedAccountsSuggestions(q) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -853,7 +853,7 @@ export function fetchPinnedAccountsSuggestions(q) {
|
||||||
dispatch(fetchPinnedAccountsSuggestionsReady(q, response.data));
|
dispatch(fetchPinnedAccountsSuggestionsReady(q, response.data));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchPinnedAccountsSuggestionsReady(query, accounts) {
|
export function fetchPinnedAccountsSuggestionsReady(query, accounts) {
|
||||||
return {
|
return {
|
||||||
|
@ -861,24 +861,24 @@ export function fetchPinnedAccountsSuggestionsReady(query, accounts) {
|
||||||
query,
|
query,
|
||||||
accounts,
|
accounts,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function clearPinnedAccountsSuggestions() {
|
export function clearPinnedAccountsSuggestions() {
|
||||||
return {
|
return {
|
||||||
type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CLEAR,
|
type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CLEAR,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function changePinnedAccountsSuggestions(value) {
|
export function changePinnedAccountsSuggestions(value) {
|
||||||
return {
|
return {
|
||||||
type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CHANGE,
|
type: PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CHANGE,
|
||||||
value,
|
value,
|
||||||
}
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function resetPinnedAccountsEditor() {
|
export function resetPinnedAccountsEditor() {
|
||||||
return {
|
return {
|
||||||
type: PINNED_ACCOUNTS_EDITOR_RESET,
|
type: PINNED_ACCOUNTS_EDITOR_RESET,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ export function initBoostModal(props) {
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BOOSTS_INIT_MODAL,
|
type: BOOSTS_INIT_MODAL,
|
||||||
privacy
|
privacy,
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch(openModal('BOOST', props));
|
dispatch(openModal('BOOST', props));
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -101,20 +101,20 @@ export function setComposeToStatus(status, text, spoiler_text, content_type) {
|
||||||
spoiler_text,
|
spoiler_text,
|
||||||
content_type,
|
content_type,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function changeCompose(text) {
|
export function changeCompose(text) {
|
||||||
return {
|
return {
|
||||||
type: COMPOSE_CHANGE,
|
type: COMPOSE_CHANGE,
|
||||||
text: text,
|
text: text,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function cycleElefriendCompose() {
|
export function cycleElefriendCompose() {
|
||||||
return {
|
return {
|
||||||
type: COMPOSE_CYCLE_ELEFRIEND,
|
type: COMPOSE_CYCLE_ELEFRIEND,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function replyCompose(status, routerHistory) {
|
export function replyCompose(status, routerHistory) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -127,19 +127,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) => {
|
||||||
|
@ -150,7 +150,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) => {
|
||||||
|
@ -161,7 +161,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) {
|
||||||
|
@ -257,34 +257,34 @@ 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 doodleSet(options) {
|
export function doodleSet(options) {
|
||||||
return {
|
return {
|
||||||
type: COMPOSE_DOODLE_SET,
|
type: COMPOSE_DOODLE_SET,
|
||||||
options: options,
|
options: options,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function uploadCompose(files) {
|
export function uploadCompose(files) {
|
||||||
return function (dispatch, getState) {
|
return function (dispatch, getState) {
|
||||||
|
@ -347,9 +347,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,
|
||||||
|
@ -407,14 +407,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 {
|
||||||
|
@ -422,7 +422,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) => {
|
||||||
|
@ -454,14 +454,14 @@ export function changeUploadCompose(id, params) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
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, attached) {
|
export function changeUploadComposeSuccess(media, attached) {
|
||||||
return {
|
return {
|
||||||
|
@ -470,7 +470,7 @@ export function changeUploadComposeSuccess(media, attached) {
|
||||||
attached: attached,
|
attached: attached,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function changeUploadComposeFail(error) {
|
export function changeUploadComposeFail(error) {
|
||||||
return {
|
return {
|
||||||
|
@ -478,14 +478,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 {
|
||||||
|
@ -493,7 +493,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 {
|
||||||
|
@ -502,7 +502,7 @@ export function uploadComposeSuccess(media, file) {
|
||||||
file: file,
|
file: file,
|
||||||
skipLoading: true,
|
skipLoading: true,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function uploadComposeFail(error) {
|
export function uploadComposeFail(error) {
|
||||||
return {
|
return {
|
||||||
|
@ -510,14 +510,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) {
|
||||||
|
@ -526,7 +526,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) {
|
||||||
|
@ -603,7 +603,7 @@ export function fetchComposeSuggestions(token) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function readyComposeSuggestionsEmojis(token, emojis) {
|
export function readyComposeSuggestionsEmojis(token, emojis) {
|
||||||
return {
|
return {
|
||||||
|
@ -611,7 +611,7 @@ export function readyComposeSuggestionsEmojis(token, emojis) {
|
||||||
token,
|
token,
|
||||||
emojis,
|
emojis,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function readyComposeSuggestionsAccounts(token, accounts) {
|
export function readyComposeSuggestionsAccounts(token, accounts) {
|
||||||
return {
|
return {
|
||||||
|
@ -619,7 +619,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,
|
||||||
|
@ -659,7 +659,7 @@ export function selectComposeSuggestion(position, token, suggestion, path) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function updateSuggestionTags(token) {
|
export function updateSuggestionTags(token) {
|
||||||
return {
|
return {
|
||||||
|
@ -707,13 +707,13 @@ 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 changeComposeAdvancedOption(option, value) {
|
export function changeComposeAdvancedOption(option, value) {
|
||||||
return {
|
return {
|
||||||
|
@ -727,7 +727,7 @@ 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,
|
||||||
|
@ -738,28 +738,28 @@ 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 changeComposeContentType(value) {
|
export function changeComposeContentType(value) {
|
||||||
return {
|
return {
|
||||||
type: COMPOSE_CONTENT_TYPE_CHANGE,
|
type: COMPOSE_CONTENT_TYPE_CHANGE,
|
||||||
value,
|
value,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function insertEmojiCompose(position, emoji) {
|
export function insertEmojiCompose(position, emoji) {
|
||||||
return {
|
return {
|
||||||
|
@ -767,26 +767,26 @@ export function insertEmojiCompose(position, emoji) {
|
||||||
position,
|
position,
|
||||||
emoji,
|
emoji,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
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 {
|
||||||
|
@ -794,14 +794,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 {
|
||||||
|
@ -809,4 +809,4 @@ export function changePollSettings(expiresIn, isMultiple) {
|
||||||
expiresIn,
|
expiresIn,
|
||||||
isMultiple,
|
isMultiple,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -11,4 +11,4 @@ export function useEmoji(emoji) {
|
||||||
|
|
||||||
dispatch(saveSettings());
|
dispatch(saveSettings());
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,21 +67,21 @@ export function unreblog(status) {
|
||||||
dispatch(unreblogFail(status, error));
|
dispatch(unreblogFail(status, error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function reblogRequest(status) {
|
export function reblogRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: REBLOG_REQUEST,
|
type: REBLOG_REQUEST,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function reblogSuccess(status) {
|
export function reblogSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: REBLOG_SUCCESS,
|
type: REBLOG_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function reblogFail(status, error) {
|
export function reblogFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -89,21 +89,21 @@ export function reblogFail(status, error) {
|
||||||
status: status,
|
status: status,
|
||||||
error: error,
|
error: error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unreblogRequest(status) {
|
export function unreblogRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: UNREBLOG_REQUEST,
|
type: UNREBLOG_REQUEST,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unreblogSuccess(status) {
|
export function unreblogSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: UNREBLOG_SUCCESS,
|
type: UNREBLOG_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unreblogFail(status, error) {
|
export function unreblogFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -111,7 +111,7 @@ export function unreblogFail(status, error) {
|
||||||
status: status,
|
status: status,
|
||||||
error: error,
|
error: error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function favourite(status) {
|
export function favourite(status) {
|
||||||
return function (dispatch, getState) {
|
return function (dispatch, getState) {
|
||||||
|
@ -124,7 +124,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) => {
|
||||||
|
@ -137,21 +137,21 @@ export function unfavourite(status) {
|
||||||
dispatch(unfavouriteFail(status, error));
|
dispatch(unfavouriteFail(status, error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function favouriteRequest(status) {
|
export function favouriteRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: FAVOURITE_REQUEST,
|
type: FAVOURITE_REQUEST,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function favouriteSuccess(status) {
|
export function favouriteSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: FAVOURITE_SUCCESS,
|
type: FAVOURITE_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function favouriteFail(status, error) {
|
export function favouriteFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -159,21 +159,21 @@ export function favouriteFail(status, error) {
|
||||||
status: status,
|
status: status,
|
||||||
error: error,
|
error: error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfavouriteRequest(status) {
|
export function unfavouriteRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: UNFAVOURITE_REQUEST,
|
type: UNFAVOURITE_REQUEST,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfavouriteSuccess(status) {
|
export function unfavouriteSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: UNFAVOURITE_SUCCESS,
|
type: UNFAVOURITE_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unfavouriteFail(status, error) {
|
export function unfavouriteFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -181,7 +181,7 @@ export function unfavouriteFail(status, error) {
|
||||||
status: status,
|
status: status,
|
||||||
error: error,
|
error: error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function bookmark(status) {
|
export function bookmark(status) {
|
||||||
return function (dispatch, getState) {
|
return function (dispatch, getState) {
|
||||||
|
@ -194,7 +194,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) => {
|
||||||
|
@ -207,21 +207,21 @@ 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) {
|
export function bookmarkSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: BOOKMARK_SUCCESS,
|
type: BOOKMARK_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function bookmarkFail(status, error) {
|
export function bookmarkFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -229,21 +229,21 @@ 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) {
|
export function unbookmarkSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: UNBOOKMARK_SUCCESS,
|
type: UNBOOKMARK_SUCCESS,
|
||||||
status: status,
|
status: status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unbookmarkFail(status, error) {
|
export function unbookmarkFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -251,7 +251,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) => {
|
||||||
|
@ -264,14 +264,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 {
|
||||||
|
@ -279,14 +279,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) => {
|
||||||
|
@ -299,14 +299,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 {
|
||||||
|
@ -314,14 +314,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) => {
|
||||||
|
@ -334,21 +334,21 @@ export function pin(status) {
|
||||||
dispatch(pinFail(status, error));
|
dispatch(pinFail(status, error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function pinRequest(status) {
|
export function pinRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: PIN_REQUEST,
|
type: PIN_REQUEST,
|
||||||
status,
|
status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function pinSuccess(status) {
|
export function pinSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: PIN_SUCCESS,
|
type: PIN_SUCCESS,
|
||||||
status,
|
status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function pinFail(status, error) {
|
export function pinFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -356,7 +356,7 @@ export function pinFail(status, error) {
|
||||||
status,
|
status,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unpin (status) {
|
export function unpin (status) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -369,21 +369,21 @@ export function unpin (status) {
|
||||||
dispatch(unpinFail(status, error));
|
dispatch(unpinFail(status, error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unpinRequest(status) {
|
export function unpinRequest(status) {
|
||||||
return {
|
return {
|
||||||
type: UNPIN_REQUEST,
|
type: UNPIN_REQUEST,
|
||||||
status,
|
status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unpinSuccess(status) {
|
export function unpinSuccess(status) {
|
||||||
return {
|
return {
|
||||||
type: UNPIN_SUCCESS,
|
type: UNPIN_SUCCESS,
|
||||||
status,
|
status,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unpinFail(status, error) {
|
export function unpinFail(status, error) {
|
||||||
return {
|
return {
|
||||||
|
@ -391,4 +391,4 @@ export function unpinFail(status, error) {
|
||||||
status,
|
status,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -33,14 +33,14 @@ export function checkDeprecatedLocalSettings() {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function clearDeprecatedLocalSettings() {
|
export function clearDeprecatedLocalSettings() {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(deleteLocalSetting(['content_warnings', 'auto_unfold']));
|
dispatch(deleteLocalSetting(['content_warnings', 'auto_unfold']));
|
||||||
dispatch(deleteLocalSetting(['swipe_to_change_columns']));
|
dispatch(deleteLocalSetting(['swipe_to_change_columns']));
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function changeLocalSetting(key, value) {
|
export function changeLocalSetting(key, value) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
|
@ -52,7 +52,7 @@ export function changeLocalSetting(key, value) {
|
||||||
|
|
||||||
dispatch(saveLocalSettings());
|
dispatch(saveLocalSettings());
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function deleteLocalSetting(key) {
|
export function deleteLocalSetting(key) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
|
@ -63,7 +63,7 @@ export function deleteLocalSetting(key) {
|
||||||
|
|
||||||
dispatch(saveLocalSettings());
|
dispatch(saveLocalSettings());
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
// __TODO :__
|
// __TODO :__
|
||||||
// Right now `saveLocalSettings()` doesn't keep track of which user
|
// Right now `saveLocalSettings()` doesn't keep track of which user
|
||||||
|
@ -74,4 +74,4 @@ export function saveLocalSettings() {
|
||||||
const localSettings = getState().get('local_settings').toJS();
|
const localSettings = getState().get('local_settings').toJS();
|
||||||
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -129,7 +129,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();
|
||||||
|
|
||||||
|
@ -209,14 +209,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 {
|
||||||
|
@ -227,7 +227,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 {
|
||||||
|
@ -236,7 +236,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) => {
|
||||||
|
@ -246,14 +246,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 deleteMarkedNotifications() {
|
export function deleteMarkedNotifications() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -277,33 +277,33 @@ export function deleteMarkedNotifications() {
|
||||||
dispatch(deleteMarkedNotificationsFail(error));
|
dispatch(deleteMarkedNotificationsFail(error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function enterNotificationClearingMode(yes) {
|
export function enterNotificationClearingMode(yes) {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_ENTER_CLEARING_MODE,
|
type: NOTIFICATIONS_ENTER_CLEARING_MODE,
|
||||||
yes: yes,
|
yes: yes,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function markAllNotifications(yes) {
|
export function markAllNotifications(yes) {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_MARK_ALL_FOR_DELETE,
|
type: NOTIFICATIONS_MARK_ALL_FOR_DELETE,
|
||||||
yes: yes, // true, false or null. null = invert
|
yes: yes, // true, false or null. null = invert
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function deleteMarkedNotificationsRequest() {
|
export function deleteMarkedNotificationsRequest() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_DELETE_MARKED_REQUEST,
|
type: NOTIFICATIONS_DELETE_MARKED_REQUEST,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function deleteMarkedNotificationsFail() {
|
export function deleteMarkedNotificationsFail() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_DELETE_MARKED_FAIL,
|
type: NOTIFICATIONS_DELETE_MARKED_FAIL,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function markNotificationForDelete(id, yes) {
|
export function markNotificationForDelete(id, yes) {
|
||||||
return {
|
return {
|
||||||
|
@ -311,32 +311,32 @@ export function markNotificationForDelete(id, yes) {
|
||||||
id: id,
|
id: id,
|
||||||
yes: yes,
|
yes: yes,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function deleteMarkedNotificationsSuccess() {
|
export function deleteMarkedNotificationsSuccess() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_DELETE_MARKED_SUCCESS,
|
type: NOTIFICATIONS_DELETE_MARKED_SUCCESS,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function mountNotifications() {
|
export function mountNotifications() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_MOUNT,
|
type: NOTIFICATIONS_MOUNT,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unmountNotifications() {
|
export function unmountNotifications() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_UNMOUNT,
|
type: NOTIFICATIONS_UNMOUNT,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function notificationsSetVisibility(visibility) {
|
export function notificationsSetVisibility(visibility) {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_SET_VISIBILITY,
|
type: NOTIFICATIONS_SET_VISIBILITY,
|
||||||
visibility: visibility,
|
visibility: visibility,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function setFilter (filterType) {
|
export function setFilter (filterType) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
|
@ -348,13 +348,13 @@ export function setFilter (filterType) {
|
||||||
dispatch(expandNotifications({ forceLoad: true }));
|
dispatch(expandNotifications({ forceLoad: true }));
|
||||||
dispatch(saveSettings());
|
dispatch(saveSettings());
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function markNotificationsAsRead() {
|
export function markNotificationsAsRead() {
|
||||||
return {
|
return {
|
||||||
type: NOTIFICATIONS_MARK_AS_READ,
|
type: NOTIFICATIONS_MARK_AS_READ,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
// Browser support
|
// Browser support
|
||||||
export function setupBrowserNotifications() {
|
export function setupBrowserNotifications() {
|
||||||
|
@ -379,7 +379,7 @@ export function requestBrowserPermission(callback = noOp) {
|
||||||
callback(permission);
|
callback(permission);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function setBrowserSupport (value) {
|
export function setBrowserSupport (value) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -11,4 +11,4 @@ export function showOnboardingOnce() {
|
||||||
dispatch(saveSettings());
|
dispatch(saveSettings());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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']);
|
||||||
|
|
|
@ -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);
|
||||||
};
|
}
|
||||||
|
|
|
@ -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, content_type) {
|
export function redraft(status, raw_text, content_type) {
|
||||||
return {
|
return {
|
||||||
|
@ -92,7 +92,7 @@ export function redraft(status, raw_text, content_type) {
|
||||||
raw_text,
|
raw_text,
|
||||||
content_type,
|
content_type,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
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]);
|
||||||
|
@ -148,21 +148,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 {
|
||||||
|
@ -170,7 +170,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));
|
||||||
|
@ -191,14 +191,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 {
|
||||||
|
@ -208,7 +208,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 {
|
||||||
|
@ -217,7 +217,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) => {
|
||||||
|
@ -229,21 +229,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 {
|
||||||
|
@ -251,7 +251,7 @@ export function muteStatusFail(id, error) {
|
||||||
id,
|
id,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function unmuteStatus(id) {
|
export function unmuteStatus(id) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -263,21 +263,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 {
|
||||||
|
@ -285,7 +285,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)) {
|
||||||
|
@ -296,7 +296,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)) {
|
||||||
|
@ -307,7 +307,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 {
|
||||||
|
@ -315,7 +315,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));
|
||||||
|
|
|
@ -18,7 +18,7 @@ const applyMigrations = (state) => {
|
||||||
if (state.getIn(['settings', 'notifications', 'showUnread']) !== false) {
|
if (state.getIn(['settings', 'notifications', 'showUnread']) !== false) {
|
||||||
state.setIn(['settings', 'notifications', 'showUnread'], state.getIn(['local_settings', 'notifications', 'show_unread']));
|
state.setIn(['settings', 'notifications', 'showUnread'], state.getIn(['local_settings', 'notifications', 'show_unread']));
|
||||||
}
|
}
|
||||||
state.removeIn(['local_settings', 'notifications', 'show_unread'])
|
state.removeIn(['local_settings', 'notifications', 'show_unread']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -36,4 +36,4 @@ export function hydrateStore(rawState) {
|
||||||
dispatch(importFetchedAccounts(Object.values(rawState.accounts)));
|
dispatch(importFetchedAccounts(Object.values(rawState.accounts)));
|
||||||
dispatch(saveSettings());
|
dispatch(saveSettings());
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -55,14 +55,14 @@ export function updateTimeline(timeline, status, accept) {
|
||||||
timeline,
|
timeline,
|
||||||
status,
|
status,
|
||||||
usePendingItems: preferPendingItems,
|
usePendingItems: preferPendingItems,
|
||||||
filtered
|
filtered,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (timeline === 'home') {
|
if (timeline === 'home') {
|
||||||
dispatch(submitMarkers());
|
dispatch(submitMarkers());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function deleteFromTimelines(id) {
|
export function deleteFromTimelines(id) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -78,13 +78,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 = () => {};
|
||||||
|
|
||||||
|
@ -134,7 +134,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) => {
|
||||||
|
@ -181,7 +181,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 {
|
||||||
|
@ -194,7 +194,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 {
|
||||||
|
@ -204,7 +204,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 {
|
||||||
|
@ -212,7 +212,7 @@ export function scrollTopTimeline(timeline, top) {
|
||||||
timeline,
|
timeline,
|
||||||
top,
|
top,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function connectTimeline(timeline) {
|
export function connectTimeline(timeline) {
|
||||||
return {
|
return {
|
||||||
|
@ -220,7 +220,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,
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
|
@ -48,27 +48,27 @@ class Account extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleFollow = () => {
|
handleFollow = () => {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlock = () => {
|
handleBlock = () => {
|
||||||
this.props.onBlock(this.props.account);
|
this.props.onBlock(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMute = () => {
|
handleMute = () => {
|
||||||
this.props.onMute(this.props.account);
|
this.props.onMute(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMuteNotifications = () => {
|
handleMuteNotifications = () => {
|
||||||
this.props.onMuteNotifications(this.props.account, true);
|
this.props.onMuteNotifications(this.props.account, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleUnmuteNotifications = () => {
|
handleUnmuteNotifications = () => {
|
||||||
this.props.onMuteNotifications(this.props.account, false);
|
this.props.onMuteNotifications(this.props.account, false);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleAction = () => {
|
handleAction = () => {
|
||||||
this.props.onActionClick(this.props.account);
|
this.props.onActionClick(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -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'>
|
||||||
|
|
|
@ -38,13 +38,13 @@ export default class AnimatedNumber extends React.PureComponent {
|
||||||
const { direction } = this.state;
|
const { direction } = this.state;
|
||||||
|
|
||||||
return { y: -1 * direction };
|
return { y: -1 * direction };
|
||||||
}
|
};
|
||||||
|
|
||||||
willLeave = () => {
|
willLeave = () => {
|
||||||
const { direction } = this.state;
|
const { direction } = this.state;
|
||||||
|
|
||||||
return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) };
|
return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) };
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { value, obfuscate } = this.props;
|
const { value, obfuscate } = this.props;
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default class AutosuggestInput extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.onChange(e);
|
this.props.onChange(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
onKeyDown = (e) => {
|
onKeyDown = (e) => {
|
||||||
const { suggestions, disabled } = this.props;
|
const { suggestions, disabled } = this.props;
|
||||||
|
@ -136,22 +136,22 @@ export default class AutosuggestInput extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.onKeyDown(e);
|
this.props.onKeyDown(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
onBlur = () => {
|
onBlur = () => {
|
||||||
this.setState({ suggestionsHidden: true, focused: false });
|
this.setState({ suggestionsHidden: true, focused: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
onFocus = () => {
|
onFocus = () => {
|
||||||
this.setState({ focused: true });
|
this.setState({ focused: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionClick = (e) => {
|
onSuggestionClick = (e) => {
|
||||||
const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index'));
|
const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index'));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
|
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
|
||||||
this.input.focus();
|
this.input.focus();
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
|
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
|
||||||
|
@ -161,7 +161,7 @@ export default class AutosuggestInput extends ImmutablePureComponent {
|
||||||
|
|
||||||
setInput = (c) => {
|
setInput = (c) => {
|
||||||
this.input = c;
|
this.input = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
renderSuggestion = (suggestion, i) => {
|
renderSuggestion = (suggestion, i) => {
|
||||||
const { selectedSuggestion } = this.state;
|
const { selectedSuggestion } = this.state;
|
||||||
|
@ -183,7 +183,7 @@ export default class AutosuggestInput extends ImmutablePureComponent {
|
||||||
{inner}
|
{inner}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props;
|
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props;
|
||||||
|
|
|
@ -75,7 +75,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.onChange(e);
|
this.props.onChange(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
onKeyDown = (e) => {
|
onKeyDown = (e) => {
|
||||||
const { suggestions, disabled } = this.props;
|
const { suggestions, disabled } = this.props;
|
||||||
|
@ -133,25 +133,25 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.onKeyDown(e);
|
this.props.onKeyDown(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
onBlur = () => {
|
onBlur = () => {
|
||||||
this.setState({ suggestionsHidden: true, focused: false });
|
this.setState({ suggestionsHidden: true, focused: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
onFocus = (e) => {
|
onFocus = (e) => {
|
||||||
this.setState({ focused: true });
|
this.setState({ focused: true });
|
||||||
if (this.props.onFocus) {
|
if (this.props.onFocus) {
|
||||||
this.props.onFocus(e);
|
this.props.onFocus(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionClick = (e) => {
|
onSuggestionClick = (e) => {
|
||||||
const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index'));
|
const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index'));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
|
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
|
||||||
this.textarea.focus();
|
this.textarea.focus();
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
|
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
|
||||||
|
@ -161,14 +161,14 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
|
|
||||||
setTextarea = (c) => {
|
setTextarea = (c) => {
|
||||||
this.textarea = c;
|
this.textarea = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
onPaste = (e) => {
|
onPaste = (e) => {
|
||||||
if (e.clipboardData && e.clipboardData.files.length === 1) {
|
if (e.clipboardData && e.clipboardData.files.length === 1) {
|
||||||
this.props.onPaste(e.clipboardData.files);
|
this.props.onPaste(e.clipboardData.files);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
renderSuggestion = (suggestion, i) => {
|
renderSuggestion = (suggestion, i) => {
|
||||||
const { selectedSuggestion } = this.state;
|
const { selectedSuggestion } = this.state;
|
||||||
|
@ -190,7 +190,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
{inner}
|
{inner}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props;
|
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props;
|
||||||
|
|
|
@ -28,12 +28,12 @@ export default class Avatar extends React.PureComponent {
|
||||||
handleMouseEnter = () => {
|
handleMouseEnter = () => {
|
||||||
if (this.props.animate) return;
|
if (this.props.animate) return;
|
||||||
this.setState({ hovering: true });
|
this.setState({ hovering: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = () => {
|
handleMouseLeave = () => {
|
||||||
if (this.props.animate) return;
|
if (this.props.animate) return;
|
||||||
this.setState({ hovering: false });
|
this.setState({ hovering: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -19,11 +19,11 @@ export default class Button extends React.PureComponent {
|
||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onClick(e);
|
this.props.onClick(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = (c) => {
|
setRef = (c) => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
focus() {
|
focus() {
|
||||||
this.node.focus();
|
this.node.focus();
|
||||||
|
|
|
@ -29,11 +29,11 @@ export default class Column extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._interruptScrollAnimation();
|
this._interruptScrollAnimation();
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
if (this.props.bindToDocument) {
|
if (this.props.bindToDocument) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default class ColumnBackButton extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.context.router.history.push('/');
|
this.context.router.history.push('/');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { multiColumn } = this.props;
|
const { multiColumn } = this.props;
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class ColumnBackButtonSlim extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.context.router.history.push('/');
|
this.context.router.history.push('/');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -55,39 +55,39 @@ class ColumnHeader extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.context.router.history.push('/');
|
this.context.router.history.push('/');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleToggleClick = (e) => {
|
handleToggleClick = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.setState({ collapsed: !this.state.collapsed, animating: true });
|
this.setState({ collapsed: !this.state.collapsed, animating: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleTitleClick = () => {
|
handleTitleClick = () => {
|
||||||
this.props.onClick?.();
|
this.props.onClick?.();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMoveLeft = () => {
|
handleMoveLeft = () => {
|
||||||
this.props.onMove(-1);
|
this.props.onMove(-1);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMoveRight = () => {
|
handleMoveRight = () => {
|
||||||
this.props.onMove(1);
|
this.props.onMove(1);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBackClick = (event) => {
|
handleBackClick = (event) => {
|
||||||
this.historyBack(event.shiftKey);
|
this.historyBack(event.shiftKey);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleTransitionEnd = () => {
|
handleTransitionEnd = () => {
|
||||||
this.setState({ animating: false });
|
this.setState({ animating: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
handlePin = () => {
|
handlePin = () => {
|
||||||
if (!this.props.pinned) {
|
if (!this.props.pinned) {
|
||||||
this.historyBack();
|
this.historyBack();
|
||||||
}
|
}
|
||||||
this.props.onPin();
|
this.props.onPin();
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props;
|
const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class DismissableBanner extends React.PureComponent {
|
||||||
handleDismiss = () => {
|
handleDismiss = () => {
|
||||||
const { id } = this.props;
|
const { id } = this.props;
|
||||||
this.setState({ visible: false }, () => bannerSettings.set(id, true));
|
this.setState({ visible: false }, () => bannerSettings.set(id, true));
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { visible } = this.state;
|
const { visible } = this.state;
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default class DisplayName extends React.PureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-original');
|
emoji.src = emoji.getAttribute('data-original');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = ({ currentTarget }) => {
|
handleMouseLeave = ({ currentTarget }) => {
|
||||||
if (autoPlayGif) {
|
if (autoPlayGif) {
|
||||||
|
@ -40,7 +40,7 @@ export default class DisplayName extends React.PureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-static');
|
emoji.src = emoji.getAttribute('data-static');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { account, className, inline, localDomain, others, onAccountClick } = this.props;
|
const { account, className, inline, localDomain, others, onAccountClick } = this.props;
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Account extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleDomainUnblock = () => {
|
handleDomainUnblock = () => {
|
||||||
this.props.onUnblockDomain(this.props.domain);
|
this.props.onUnblockDomain(this.props.domain);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { domain, intl } = this.props;
|
const { domain, intl } = this.props;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class DropdownMenu extends React.PureComponent {
|
||||||
if (this.node && !this.node.contains(e.target)) {
|
if (this.node && !this.node.contains(e.target)) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
document.addEventListener('click', this.handleDocumentClick, false);
|
document.addEventListener('click', this.handleDocumentClick, false);
|
||||||
|
@ -56,11 +56,11 @@ class DropdownMenu extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setFocusRef = c => {
|
setFocusRef = c => {
|
||||||
this.focusedItem = c;
|
this.focusedItem = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
const items = Array.from(this.node.querySelectorAll('a, button'));
|
const items = Array.from(this.node.querySelectorAll('a, button'));
|
||||||
|
@ -97,18 +97,18 @@ class DropdownMenu extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleItemKeyPress = e => {
|
handleItemKeyPress = e => {
|
||||||
if (e.key === 'Enter' || e.key === ' ') {
|
if (e.key === 'Enter' || e.key === ' ') {
|
||||||
this.handleClick(e);
|
this.handleClick(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClick = e => {
|
handleClick = e => {
|
||||||
const { onItemClick } = this.props;
|
const { onItemClick } = this.props;
|
||||||
onItemClick(e);
|
onItemClick(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderItem = (option, i) => {
|
renderItem = (option, i) => {
|
||||||
if (option === null) {
|
if (option === null) {
|
||||||
|
@ -124,7 +124,7 @@ class DropdownMenu extends React.PureComponent {
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { items, scrollable, renderHeader, loading } = this.props;
|
const { items, scrollable, renderHeader, loading } = this.props;
|
||||||
|
@ -194,7 +194,7 @@ export default class Dropdown extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.props.onOpen(this.state.id, this.handleItemClick, type !== 'click');
|
this.props.onOpen(this.state.id, this.handleItemClick, type !== 'click');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClose = () => {
|
handleClose = () => {
|
||||||
if (this.activeElement) {
|
if (this.activeElement) {
|
||||||
|
@ -202,13 +202,13 @@ export default class Dropdown extends React.PureComponent {
|
||||||
this.activeElement = null;
|
this.activeElement = null;
|
||||||
}
|
}
|
||||||
this.props.onClose(this.state.id);
|
this.props.onClose(this.state.id);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = () => {
|
handleMouseDown = () => {
|
||||||
if (!this.state.open) {
|
if (!this.state.open) {
|
||||||
this.activeElement = document.activeElement;
|
this.activeElement = document.activeElement;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleButtonKeyDown = (e) => {
|
handleButtonKeyDown = (e) => {
|
||||||
switch(e.key) {
|
switch(e.key) {
|
||||||
|
@ -217,7 +217,7 @@ export default class Dropdown extends React.PureComponent {
|
||||||
this.handleMouseDown();
|
this.handleMouseDown();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
switch(e.key) {
|
switch(e.key) {
|
||||||
|
@ -228,7 +228,7 @@ export default class Dropdown extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleItemClick = e => {
|
handleItemClick = e => {
|
||||||
const { onItemClick } = this.props;
|
const { onItemClick } = this.props;
|
||||||
|
@ -247,25 +247,25 @@ export default class Dropdown extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.context.router.history.push(item.to);
|
this.context.router.history.push(item.to);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setTargetRef = c => {
|
setTargetRef = c => {
|
||||||
this.target = c;
|
this.target = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
findTarget = () => {
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillUnmount = () => {
|
componentWillUnmount = () => {
|
||||||
if (this.state.id === this.props.openDropdownId) {
|
if (this.state.id === this.props.openDropdownId) {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
close = () => {
|
close = () => {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class EditedTimestamp extends React.PureComponent {
|
||||||
return (
|
return (
|
||||||
<FormattedMessage id='status.edited_x_times' defaultMessage='Edited {count, plural, one {{count} time} other {{count} times}}' values={{ count: items.size - 1 }} />
|
<FormattedMessage id='status.edited_x_times' defaultMessage='Edited {count, plural, one {{count} time} other {{count} times}}' values={{ count: items.size - 1 }} />
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderItem = (item, index, { onClick, onKeyPress }) => {
|
renderItem = (item, index, { onClick, onKeyPress }) => {
|
||||||
const formattedDate = <RelativeTimestamp timestamp={item.get('created_at')} short={false} />;
|
const formattedDate = <RelativeTimestamp timestamp={item.get('created_at')} short={false} />;
|
||||||
|
@ -53,7 +53,7 @@ class EditedTimestamp extends React.PureComponent {
|
||||||
<button data-index={index} onClick={onClick} onKeyPress={onKeyPress}>{label}</button>
|
<button data-index={index} onClick={onClick} onKeyPress={onKeyPress}>{label}</button>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { timestamp, intl, statusId } = this.props;
|
const { timestamp, intl, statusId } = this.props;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class ErrorBoundary extends React.PureComponent {
|
||||||
stackTrace: undefined,
|
stackTrace: undefined,
|
||||||
mappedStackTrace: undefined,
|
mappedStackTrace: undefined,
|
||||||
componentStack: undefined,
|
componentStack: undefined,
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidCatch(error, info) {
|
componentDidCatch(error, info) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default class GIFV extends React.PureComponent {
|
||||||
|
|
||||||
handleLoadedData = () => {
|
handleLoadedData = () => {
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.src !== this.props.src) {
|
if (nextProps.src !== this.props.src) {
|
||||||
|
@ -32,7 +32,7 @@ export default class GIFV extends React.PureComponent {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onClick();
|
onClick();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { src, width, height, alt } = this.props;
|
const { src, width, height, alt } = this.props;
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default class IconButton extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
activate: false,
|
activate: false,
|
||||||
deactivate: false,
|
deactivate: false,
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (!nextProps.animate) return;
|
if (!nextProps.animate) return;
|
||||||
|
@ -64,25 +64,25 @@ export default class IconButton extends React.PureComponent {
|
||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onClick(e);
|
this.props.onClick(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
if (this.props.onKeyPress && !this.props.disabled) {
|
if (this.props.onKeyPress && !this.props.disabled) {
|
||||||
this.props.onKeyPress(e);
|
this.props.onKeyPress(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = (e) => {
|
handleMouseDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onMouseDown) {
|
if (!this.props.disabled && this.props.onMouseDown) {
|
||||||
this.props.onMouseDown(e);
|
this.props.onMouseDown(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onKeyDown) {
|
if (!this.props.disabled && this.props.onKeyDown) {
|
||||||
this.props.onKeyDown(e);
|
this.props.onKeyDown(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
// Hack required for some icons which have an overriden size
|
// Hack required for some icons which have an overriden size
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
isHidden: false, // set to true in requestIdleCallback to trigger un-render
|
isHidden: false, // set to true in requestIdleCallback to trigger un-render
|
||||||
}
|
};
|
||||||
|
|
||||||
shouldComponentUpdate (nextProps, nextState) {
|
shouldComponentUpdate (nextProps, nextState) {
|
||||||
const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);
|
const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);
|
||||||
|
@ -63,7 +63,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
|
|
||||||
scheduleIdleTask(this.calculateHeight);
|
scheduleIdleTask(this.calculateHeight);
|
||||||
this.setState(this.updateStateAfterIntersection);
|
this.setState(this.updateStateAfterIntersection);
|
||||||
}
|
};
|
||||||
|
|
||||||
updateStateAfterIntersection = (prevState) => {
|
updateStateAfterIntersection = (prevState) => {
|
||||||
if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
|
if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
|
||||||
|
@ -73,7 +73,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
isIntersecting: this.entry.isIntersecting,
|
isIntersecting: this.entry.isIntersecting,
|
||||||
isHidden: false,
|
isHidden: false,
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
calculateHeight = () => {
|
calculateHeight = () => {
|
||||||
const { onHeightChange, saveHeightKey, id } = this.props;
|
const { onHeightChange, saveHeightKey, id } = this.props;
|
||||||
|
@ -84,7 +84,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
if (onHeightChange && saveHeightKey) {
|
if (onHeightChange && saveHeightKey) {
|
||||||
onHeightChange(saveHeightKey, id, this.height);
|
onHeightChange(saveHeightKey, id, this.height);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
hideIfNotIntersecting = () => {
|
hideIfNotIntersecting = () => {
|
||||||
if (!this.componentMounted) {
|
if (!this.componentMounted) {
|
||||||
|
@ -96,11 +96,11 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
// this is to save DOM nodes and avoid using up too much memory.
|
// this is to save DOM nodes and avoid using up too much memory.
|
||||||
// See: https://github.com/mastodon/mastodon/issues/2900
|
// See: https://github.com/mastodon/mastodon/issues/2900
|
||||||
this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));
|
this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRef = (node) => {
|
handleRef = (node) => {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { children, id, index, listLength, cachedHeight } = this.props;
|
const { children, id, index, listLength, cachedHeight } = this.props;
|
||||||
|
@ -121,7 +121,8 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
aria-setsize={listLength}
|
aria-setsize={listLength}
|
||||||
data-id={id}
|
data-id={id}
|
||||||
tabIndex='0'
|
tabIndex='0'
|
||||||
style={style}>
|
style={style}
|
||||||
|
>
|
||||||
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })}
|
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })}
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,7 +19,7 @@ class LoadGap extends React.PureComponent {
|
||||||
|
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
this.props.onClick(this.props.maxId);
|
this.props.onClick(this.props.maxId);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { disabled, intl } = this.props;
|
const { disabled, intl } = this.props;
|
||||||
|
|
|
@ -8,11 +8,11 @@ export default class LoadMore extends React.PureComponent {
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
}
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
visible: true,
|
visible: true,
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { disabled, visible } = this.props;
|
const { disabled, visible } = this.props;
|
||||||
|
|
|
@ -7,7 +7,7 @@ export default class LoadPending extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
count: PropTypes.number,
|
count: PropTypes.number,
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { count } = this.props;
|
const { count } = this.props;
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
|
||||||
return (
|
return (
|
||||||
<div className='media-gallery' style={{ height, width }} />
|
<div className='media-gallery' style={{ height, width }} />
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderLoadingVideoPlayer = () => {
|
renderLoadingVideoPlayer = () => {
|
||||||
const { height, width } = this.props;
|
const { height, width } = this.props;
|
||||||
|
@ -38,7 +38,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
|
||||||
return (
|
return (
|
||||||
<div className='video-player' style={{ height, width }} />
|
<div className='video-player' style={{ height, width }} />
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderLoadingAudioPlayer = () => {
|
renderLoadingAudioPlayer = () => {
|
||||||
const { height, width } = this.props;
|
const { height, width } = this.props;
|
||||||
|
@ -46,7 +46,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
|
||||||
return (
|
return (
|
||||||
<div className='audio-player' style={{ height, width }} />
|
<div className='audio-player' style={{ height, width }} />
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, width, height, revealed } = this.props;
|
const { status, width, height, revealed } = this.props;
|
||||||
|
|
|
@ -60,14 +60,14 @@ class Item extends React.PureComponent {
|
||||||
if (this.hoverToPlay()) {
|
if (this.hoverToPlay()) {
|
||||||
e.target.play();
|
e.target.play();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = (e) => {
|
handleMouseLeave = (e) => {
|
||||||
if (this.hoverToPlay()) {
|
if (this.hoverToPlay()) {
|
||||||
e.target.pause();
|
e.target.pause();
|
||||||
e.target.currentTime = 0;
|
e.target.currentTime = 0;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
getAutoPlay() {
|
getAutoPlay() {
|
||||||
return this.props.autoplay || autoPlayGif;
|
return this.props.autoplay || autoPlayGif;
|
||||||
|
@ -91,11 +91,11 @@ class Item extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleImageLoad = () => {
|
handleImageLoad = () => {
|
||||||
this.setState({ loaded: true });
|
this.setState({ loaded: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { attachment, index, size, standalone, letterbox, displayWidth, visible } = this.props;
|
const { attachment, index, size, standalone, letterbox, displayWidth, visible } = this.props;
|
||||||
|
@ -307,11 +307,11 @@ class MediaGallery extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.setState({ visible: !this.state.visible });
|
this.setState({ visible: !this.state.visible });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClick = (index) => {
|
handleClick = (index) => {
|
||||||
this.props.onOpenMedia(this.props.media, index);
|
this.props.onOpenMedia(this.props.media, index);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRef = (node) => {
|
handleRef = (node) => {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
|
@ -319,7 +319,7 @@ class MediaGallery extends React.PureComponent {
|
||||||
if (this.node) {
|
if (this.node) {
|
||||||
this._setDimensions();
|
this._setDimensions();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
_setDimensions () {
|
_setDimensions () {
|
||||||
const width = this.node.offsetWidth;
|
const width = this.node.offsetWidth;
|
||||||
|
@ -360,7 +360,7 @@ class MediaGallery extends React.PureComponent {
|
||||||
} else if (width) {
|
} else if (width) {
|
||||||
style.height = width / (16/9);
|
style.height = width / (16/9);
|
||||||
} else {
|
} else {
|
||||||
return (<div className={computedClass} ref={this.handleRef}></div>);
|
return (<div className={computedClass} ref={this.handleRef} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isStandaloneEligible()) {
|
if (this.isStandaloneEligible()) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { createBrowserHistory } from 'history';
|
||||||
import { multiply } from 'color-blend';
|
import { multiply } from 'color-blend';
|
||||||
|
|
||||||
export default class ModalRoot extends React.PureComponent {
|
export default class ModalRoot extends React.PureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
router: PropTypes.object,
|
router: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
@ -28,7 +29,7 @@ export default class ModalRoot extends React.PureComponent {
|
||||||
&& !!this.props.children && !this.props.noEsc) {
|
&& !!this.props.children && !this.props.noEsc) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (e.key === 'Tab') {
|
if (e.key === 'Tab') {
|
||||||
|
@ -49,7 +50,7 @@ export default class ModalRoot extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
window.addEventListener('keyup', this.handleKeyUp, false);
|
window.addEventListener('keyup', this.handleKeyUp, false);
|
||||||
|
@ -125,11 +126,11 @@ export default class ModalRoot extends React.PureComponent {
|
||||||
|
|
||||||
getSiblings = () => {
|
getSiblings = () => {
|
||||||
return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node);
|
return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node);
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = ref => {
|
setRef = ref => {
|
||||||
this.node = ref;
|
this.node = ref;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { children, onClose } = this.props;
|
const { children, onClose } = this.props;
|
||||||
|
|
|
@ -24,12 +24,12 @@ export default class Permalink extends React.PureComponent {
|
||||||
|
|
||||||
if (this.context.router) {
|
if (this.context.router) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let state = {...this.context.router.history.location.state};
|
let state = { ...this.context.router.history.location.state };
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
this.context.router.history.push(this.props.to, state);
|
this.context.router.history.push(this.props.to, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -22,7 +22,7 @@ class PictureInPicturePlaceholder extends React.PureComponent {
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
dispatch(removePictureInPicture());
|
dispatch(removePictureInPicture());
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
|
@ -30,7 +30,7 @@ class PictureInPicturePlaceholder extends React.PureComponent {
|
||||||
if (this.node) {
|
if (this.node) {
|
||||||
this._setDimensions();
|
this._setDimensions();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
_setDimensions () {
|
_setDimensions () {
|
||||||
const width = this.node.offsetWidth;
|
const width = this.node.offsetWidth;
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Poll extends ImmutablePureComponent {
|
||||||
tmp[value] = true;
|
tmp[value] = true;
|
||||||
this.setState({ selected: tmp });
|
this.setState({ selected: tmp });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOptionChange = ({ target: { value } }) => {
|
handleOptionChange = ({ target: { value } }) => {
|
||||||
this._toggleOption(value);
|
this._toggleOption(value);
|
||||||
|
@ -107,7 +107,7 @@ class Poll extends ImmutablePureComponent {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleVote = () => {
|
handleVote = () => {
|
||||||
if (this.props.disabled) {
|
if (this.props.disabled) {
|
||||||
|
|
|
@ -137,7 +137,7 @@ class ScrollableList extends PureComponent {
|
||||||
}
|
}
|
||||||
this.mouseMovedRecently = false;
|
this.mouseMovedRecently = false;
|
||||||
this.scrollToTopOnMouseIdle = false;
|
this.scrollToTopOnMouseIdle = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this.attachScrollListener();
|
this.attachScrollListener();
|
||||||
|
@ -154,29 +154,29 @@ class ScrollableList extends PureComponent {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
getScrollTop = () => {
|
getScrollTop = () => {
|
||||||
return this.props.bindToDocument ? document.scrollingElement.scrollTop : this.node.scrollTop;
|
return this.props.bindToDocument ? document.scrollingElement.scrollTop : this.node.scrollTop;
|
||||||
}
|
};
|
||||||
|
|
||||||
getScrollHeight = () => {
|
getScrollHeight = () => {
|
||||||
return this.props.bindToDocument ? document.scrollingElement.scrollHeight : this.node.scrollHeight;
|
return this.props.bindToDocument ? document.scrollingElement.scrollHeight : this.node.scrollHeight;
|
||||||
}
|
};
|
||||||
|
|
||||||
getClientHeight = () => {
|
getClientHeight = () => {
|
||||||
return this.props.bindToDocument ? document.scrollingElement.clientHeight : this.node.clientHeight;
|
return this.props.bindToDocument ? document.scrollingElement.clientHeight : this.node.clientHeight;
|
||||||
}
|
};
|
||||||
|
|
||||||
updateScrollBottom = (snapshot) => {
|
updateScrollBottom = (snapshot) => {
|
||||||
const newScrollTop = this.getScrollHeight() - snapshot;
|
const newScrollTop = this.getScrollHeight() - snapshot;
|
||||||
|
|
||||||
this.setScrollTop(newScrollTop);
|
this.setScrollTop(newScrollTop);
|
||||||
}
|
};
|
||||||
|
|
||||||
cacheMediaWidth = (width) => {
|
cacheMediaWidth = (width) => {
|
||||||
if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width });
|
if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width });
|
||||||
}
|
};
|
||||||
|
|
||||||
getSnapshotBeforeUpdate (prevProps, prevState) {
|
getSnapshotBeforeUpdate (prevProps, prevState) {
|
||||||
const someItemInserted = React.Children.count(prevProps.children) > 0 &&
|
const someItemInserted = React.Children.count(prevProps.children) > 0 &&
|
||||||
|
@ -208,7 +208,7 @@ class ScrollableList extends PureComponent {
|
||||||
|
|
||||||
onFullScreenChange = () => {
|
onFullScreenChange = () => {
|
||||||
this.setState({ fullscreen: isFullscreen() });
|
this.setState({ fullscreen: isFullscreen() });
|
||||||
}
|
};
|
||||||
|
|
||||||
attachIntersectionObserver () {
|
attachIntersectionObserver () {
|
||||||
this.intersectionObserverWrapper.connect({
|
this.intersectionObserverWrapper.connect({
|
||||||
|
@ -256,12 +256,12 @@ class ScrollableList extends PureComponent {
|
||||||
|
|
||||||
setRef = (c) => {
|
setRef = (c) => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadMore = e => {
|
handleLoadMore = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onLoadMore();
|
this.props.onLoadMore();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadPending = e => {
|
handleLoadPending = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -273,7 +273,7 @@ class ScrollableList extends PureComponent {
|
||||||
this.clearMouseIdleTimer();
|
this.clearMouseIdleTimer();
|
||||||
this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);
|
this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);
|
||||||
this.mouseMovedRecently = true;
|
this.mouseMovedRecently = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props;
|
const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props;
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default class SettingText extends React.PureComponent {
|
||||||
|
|
||||||
handleChange = (e) => {
|
handleChange = (e) => {
|
||||||
this.props.onChange(this.props.settingPath, e.target.value);
|
this.props.onChange(this.props.settingPath, e.target.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { settings, settingPath, label } = this.props;
|
const { settings, settingPath, label } = this.props;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
class Spoilers extends React.PureComponent {
|
class Spoilers extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
spoilerText: PropTypes.string,
|
spoilerText: PropTypes.string,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
|
@ -11,27 +12,27 @@ class Spoilers extends React.PureComponent {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
hidden: true,
|
hidden: true,
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSpoilerClick = () => {
|
handleSpoilerClick = () => {
|
||||||
this.setState({ hidden: !this.state.hidden });
|
this.setState({ hidden: !this.state.hidden });
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { spoilerText, children } = this.props;
|
const { spoilerText, children } = this.props;
|
||||||
const { hidden } = this.state;
|
const { hidden } = this.state;
|
||||||
|
|
||||||
const toggleText = hidden ?
|
const toggleText = hidden ?
|
||||||
<FormattedMessage
|
(<FormattedMessage
|
||||||
id='status.show_more'
|
id='status.show_more'
|
||||||
defaultMessage='Show more'
|
defaultMessage='Show more'
|
||||||
key='0'
|
key='0'
|
||||||
/> :
|
/>) :
|
||||||
<FormattedMessage
|
(<FormattedMessage
|
||||||
id='status.show_less'
|
id='status.show_less'
|
||||||
defaultMessage='Show less'
|
defaultMessage='Show less'
|
||||||
key='0'
|
key='0'
|
||||||
/>;
|
/>);
|
||||||
|
|
||||||
return ([
|
return ([
|
||||||
<p className='spoiler__text'>
|
<p className='spoiler__text'>
|
||||||
|
@ -43,8 +44,9 @@ class Spoilers extends React.PureComponent {
|
||||||
</p>,
|
</p>,
|
||||||
<div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
|
<div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ export const defaultMediaVisibility = (status, settings) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');
|
return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');
|
||||||
}
|
};
|
||||||
|
|
||||||
export default @injectIntl
|
export default @injectIntl
|
||||||
class Status extends ImmutablePureComponent {
|
class Status extends ImmutablePureComponent {
|
||||||
|
@ -117,7 +117,7 @@ class Status extends ImmutablePureComponent {
|
||||||
revealBehindCW: undefined,
|
revealBehindCW: undefined,
|
||||||
showCard: false,
|
showCard: false,
|
||||||
forceFilter: undefined,
|
forceFilter: undefined,
|
||||||
}
|
};
|
||||||
|
|
||||||
// Avoid checking props that are functions (and whose equality will always
|
// Avoid checking props that are functions (and whose equality will always
|
||||||
// evaluate to false. See react-immutable-pure-component for usage.
|
// evaluate to false. See react-immutable-pure-component for usage.
|
||||||
|
@ -132,14 +132,14 @@ class Status extends ImmutablePureComponent {
|
||||||
'expanded',
|
'expanded',
|
||||||
'unread',
|
'unread',
|
||||||
'pictureInPicture',
|
'pictureInPicture',
|
||||||
]
|
];
|
||||||
|
|
||||||
updateOnStates = [
|
updateOnStates = [
|
||||||
'isExpanded',
|
'isExpanded',
|
||||||
'isCollapsed',
|
'isCollapsed',
|
||||||
'showMedia',
|
'showMedia',
|
||||||
'forceFilter',
|
'forceFilter',
|
||||||
]
|
];
|
||||||
|
|
||||||
// If our settings have changed to disable collapsed statuses, then we
|
// If our settings have changed to disable collapsed statuses, then we
|
||||||
// need to make sure that we uncollapse every one. We do that by watching
|
// need to make sure that we uncollapse every one. We do that by watching
|
||||||
|
@ -302,7 +302,9 @@ class Status extends ImmutablePureComponent {
|
||||||
if (this.node && this.props.getScrollPosition) {
|
if (this.node && this.props.getScrollPosition) {
|
||||||
const position = this.props.getScrollPosition();
|
const position = this.props.getScrollPosition();
|
||||||
if (position !== null && this.node.offsetTop < position.top) {
|
if (position !== null && this.node.offsetTop < position.top) {
|
||||||
requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); });
|
requestAnimationFrame(() => {
|
||||||
|
this.props.updateScrollBottom(position.height - position.top);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +323,7 @@ class Status extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isCollapsed: false });
|
this.setState({ isCollapsed: false });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setExpansion = (value) => {
|
setExpansion = (value) => {
|
||||||
if (this.props.settings.getIn(['content_warnings', 'shared_state']) && this.props.status.get('hidden') === value) {
|
if (this.props.settings.getIn(['content_warnings', 'shared_state']) && this.props.status.get('hidden') === value) {
|
||||||
|
@ -332,7 +334,7 @@ class Status extends ImmutablePureComponent {
|
||||||
if (value) {
|
if (value) {
|
||||||
this.setCollapsed(false);
|
this.setCollapsed(false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// `parseClick()` takes a click event and responds appropriately.
|
// `parseClick()` takes a click event and responds appropriately.
|
||||||
// If our status is collapsed, then clicking on it should uncollapse it.
|
// If our status is collapsed, then clicking on it should uncollapse it.
|
||||||
|
@ -361,17 +363,17 @@ class Status extends ImmutablePureComponent {
|
||||||
status.getIn(['reblog', 'id'], status.get('id'))
|
status.getIn(['reblog', 'id'], status.get('id'))
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
let state = {...router.history.location.state};
|
let state = { ...router.history.location.state };
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
router.history.push(destination, state);
|
router.history.push(destination, state);
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleToggleMediaVisibility = () => {
|
handleToggleMediaVisibility = () => {
|
||||||
this.setState({ showMedia: !this.state.showMedia });
|
this.setState({ showMedia: !this.state.showMedia });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleExpandedToggle = () => {
|
handleExpandedToggle = () => {
|
||||||
if (this.props.settings.getIn(['content_warnings', 'shared_state'])) {
|
if (this.props.settings.getIn(['content_warnings', 'shared_state'])) {
|
||||||
|
@ -384,11 +386,11 @@ class Status extends ImmutablePureComponent {
|
||||||
handleOpenVideo = (options) => {
|
handleOpenVideo = (options) => {
|
||||||
const { status } = this.props;
|
const { status } = this.props;
|
||||||
this.props.onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), options);
|
this.props.onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), options);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpenMedia = (media, index) => {
|
handleOpenMedia = (media, index) => {
|
||||||
this.props.onOpenMedia(this.props.status.get('id'), media, index);
|
this.props.onOpenMedia(this.props.status.get('id'), media, index);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyOpenMedia = e => {
|
handleHotkeyOpenMedia = e => {
|
||||||
const { status, onOpenMedia, onOpenVideo } = this.props;
|
const { status, onOpenMedia, onOpenVideo } = this.props;
|
||||||
|
@ -403,84 +405,84 @@ class Status extends ImmutablePureComponent {
|
||||||
onOpenMedia(statusId, status.get('media_attachments'), 0);
|
onOpenMedia(statusId, status.get('media_attachments'), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDeployPictureInPicture = (type, mediaProps) => {
|
handleDeployPictureInPicture = (type, mediaProps) => {
|
||||||
const { deployPictureInPicture, status } = this.props;
|
const { deployPictureInPicture, status } = this.props;
|
||||||
|
|
||||||
deployPictureInPicture(status, type, mediaProps);
|
deployPictureInPicture(status, type, mediaProps);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyReply = e => {
|
handleHotkeyReply = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onReply(this.props.status, this.context.router.history);
|
this.props.onReply(this.props.status, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyFavourite = (e) => {
|
handleHotkeyFavourite = (e) => {
|
||||||
this.props.onFavourite(this.props.status, e);
|
this.props.onFavourite(this.props.status, e);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyBoost = e => {
|
handleHotkeyBoost = e => {
|
||||||
this.props.onReblog(this.props.status, e);
|
this.props.onReblog(this.props.status, e);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyBookmark = e => {
|
handleHotkeyBookmark = e => {
|
||||||
this.props.onBookmark(this.props.status, e);
|
this.props.onBookmark(this.props.status, e);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyMention = e => {
|
handleHotkeyMention = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyOpen = () => {
|
handleHotkeyOpen = () => {
|
||||||
let state = {...this.context.router.history.location.state};
|
let state = { ...this.context.router.history.location.state };
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
const status = this.props.status;
|
const status = this.props.status;
|
||||||
this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`, state);
|
this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`, state);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyOpenProfile = () => {
|
handleHotkeyOpenProfile = () => {
|
||||||
let state = {...this.context.router.history.location.state};
|
let state = { ...this.context.router.history.location.state };
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
|
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyMoveUp = e => {
|
handleHotkeyMoveUp = e => {
|
||||||
this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));
|
this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyMoveDown = e => {
|
handleHotkeyMoveDown = e => {
|
||||||
this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));
|
this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyCollapse = e => {
|
handleHotkeyCollapse = e => {
|
||||||
if (!this.props.settings.getIn(['collapsed', 'enabled']))
|
if (!this.props.settings.getIn(['collapsed', 'enabled']))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.setCollapsed(!this.state.isCollapsed);
|
this.setCollapsed(!this.state.isCollapsed);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHotkeyToggleSensitive = () => {
|
handleHotkeyToggleSensitive = () => {
|
||||||
this.handleToggleMediaVisibility();
|
this.handleToggleMediaVisibility();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleUnfilterClick = e => {
|
handleUnfilterClick = e => {
|
||||||
this.setState({ forceFilter: false });
|
this.setState({ forceFilter: false });
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFilterClick = () => {
|
handleFilterClick = () => {
|
||||||
this.setState({ forceFilter: true });
|
this.setState({ forceFilter: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRef = c => {
|
handleRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleTranslate = () => {
|
handleTranslate = () => {
|
||||||
this.props.onTranslate(this.props.status);
|
this.props.onTranslate(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
renderLoadingMediaGallery () {
|
renderLoadingMediaGallery () {
|
||||||
return <div className='media-gallery' style={{ height: '110px' }} />;
|
return <div className='media-gallery' style={{ height: '110px' }} />;
|
||||||
|
|
|
@ -86,7 +86,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
'showReplyCount',
|
'showReplyCount',
|
||||||
'withCounters',
|
'withCounters',
|
||||||
'withDismiss',
|
'withDismiss',
|
||||||
]
|
];
|
||||||
|
|
||||||
handleReplyClick = () => {
|
handleReplyClick = () => {
|
||||||
const { signedIn } = this.context.identity;
|
const { signedIn } = this.context.identity;
|
||||||
|
@ -96,14 +96,14 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.props.onInteractionModal('reply', this.props.status);
|
this.props.onInteractionModal('reply', this.props.status);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleShareClick = () => {
|
handleShareClick = () => {
|
||||||
navigator.share({
|
navigator.share({
|
||||||
text: this.props.status.get('search_index'),
|
text: this.props.status.get('search_index'),
|
||||||
url: this.props.status.get('url'),
|
url: this.props.status.get('url'),
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFavouriteClick = (e) => {
|
handleFavouriteClick = (e) => {
|
||||||
const { signedIn } = this.context.identity;
|
const { signedIn } = this.context.identity;
|
||||||
|
@ -113,7 +113,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.props.onInteractionModal('favourite', this.props.status);
|
this.props.onInteractionModal('favourite', this.props.status);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReblogClick = e => {
|
handleReblogClick = e => {
|
||||||
const { signedIn } = this.context.identity;
|
const { signedIn } = this.context.identity;
|
||||||
|
@ -123,78 +123,78 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.props.onInteractionModal('reblog', this.props.status);
|
this.props.onInteractionModal('reblog', this.props.status);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBookmarkClick = (e) => {
|
handleBookmarkClick = (e) => {
|
||||||
this.props.onBookmark(this.props.status, e);
|
this.props.onBookmark(this.props.status, e);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDeleteClick = () => {
|
handleDeleteClick = () => {
|
||||||
this.props.onDelete(this.props.status, this.context.router.history);
|
this.props.onDelete(this.props.status, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRedraftClick = () => {
|
handleRedraftClick = () => {
|
||||||
this.props.onDelete(this.props.status, this.context.router.history, true);
|
this.props.onDelete(this.props.status, this.context.router.history, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleEditClick = () => {
|
handleEditClick = () => {
|
||||||
this.props.onEdit(this.props.status, this.context.router.history);
|
this.props.onEdit(this.props.status, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handlePinClick = () => {
|
handlePinClick = () => {
|
||||||
this.props.onPin(this.props.status);
|
this.props.onPin(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMentionClick = () => {
|
handleMentionClick = () => {
|
||||||
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
this.props.onMention(this.props.status.get('account'), this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDirectClick = () => {
|
handleDirectClick = () => {
|
||||||
this.props.onDirect(this.props.status.get('account'), this.context.router.history);
|
this.props.onDirect(this.props.status.get('account'), this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMuteClick = () => {
|
handleMuteClick = () => {
|
||||||
this.props.onMute(this.props.status.get('account'));
|
this.props.onMute(this.props.status.get('account'));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlockClick = () => {
|
handleBlockClick = () => {
|
||||||
this.props.onBlock(this.props.status);
|
this.props.onBlock(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpen = () => {
|
handleOpen = () => {
|
||||||
let state = {...this.context.router.history.location.state};
|
let state = { ...this.context.router.history.location.state };
|
||||||
if (state.mastodonModalKey) {
|
if (state.mastodonModalKey) {
|
||||||
this.context.router.history.replace(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 });
|
this.context.router.history.replace(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 });
|
||||||
} else {
|
} else {
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, state);
|
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, state);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleEmbed = () => {
|
handleEmbed = () => {
|
||||||
this.props.onEmbed(this.props.status);
|
this.props.onEmbed(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReport = () => {
|
handleReport = () => {
|
||||||
this.props.onReport(this.props.status);
|
this.props.onReport(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleConversationMuteClick = () => {
|
handleConversationMuteClick = () => {
|
||||||
this.props.onMuteConversation(this.props.status);
|
this.props.onMuteConversation(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleCopy = () => {
|
handleCopy = () => {
|
||||||
const url = this.props.status.get('url');
|
const url = this.props.status.get('url');
|
||||||
navigator.clipboard.writeText(url);
|
navigator.clipboard.writeText(url);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHideClick = () => {
|
handleHideClick = () => {
|
||||||
this.props.onFilter();
|
this.props.onFilter();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFilterClick = () => {
|
handleFilterClick = () => {
|
||||||
this.props.onAddFilter(this.props.status);
|
this.props.onAddFilter(this.props.status);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props;
|
const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props;
|
||||||
|
|
|
@ -12,7 +12,7 @@ const textMatchesTarget = (text, origin, host) => {
|
||||||
return (text === origin || text === host
|
return (text === origin || text === host
|
||||||
|| text.startsWith(origin + '/') || text.startsWith(host + '/')
|
|| text.startsWith(origin + '/') || text.startsWith(host + '/')
|
||||||
|| 'www.' + text === host || ('www.' + text).startsWith(host + '/'));
|
|| 'www.' + text === host || ('www.' + text).startsWith(host + '/'));
|
||||||
}
|
};
|
||||||
|
|
||||||
const isLinkMisleading = (link) => {
|
const isLinkMisleading = (link) => {
|
||||||
let linkTextParts = [];
|
let linkTextParts = [];
|
||||||
|
@ -210,7 +210,7 @@ class StatusContent extends React.PureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-original');
|
emoji.src = emoji.getAttribute('data-original');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = ({ currentTarget }) => {
|
handleMouseLeave = ({ currentTarget }) => {
|
||||||
if (autoPlayGif) {
|
if (autoPlayGif) {
|
||||||
|
@ -223,7 +223,7 @@ class StatusContent extends React.PureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-static');
|
emoji.src = emoji.getAttribute('data-static');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this._updateStatusLinks();
|
this._updateStatusLinks();
|
||||||
|
@ -238,13 +238,13 @@ class StatusContent extends React.PureComponent {
|
||||||
if (this.props.collapsed) {
|
if (this.props.collapsed) {
|
||||||
if (this.props.parseClick) this.props.parseClick(e);
|
if (this.props.parseClick) this.props.parseClick(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onMentionClick = (mention, e) => {
|
onMentionClick = (mention, e) => {
|
||||||
if (this.props.parseClick) {
|
if (this.props.parseClick) {
|
||||||
this.props.parseClick(e, `/@${mention.get('acct')}`);
|
this.props.parseClick(e, `/@${mention.get('acct')}`);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onHashtagClick = (hashtag, e) => {
|
onHashtagClick = (hashtag, e) => {
|
||||||
hashtag = hashtag.replace(/^#/, '');
|
hashtag = hashtag.replace(/^#/, '');
|
||||||
|
@ -252,11 +252,11 @@ class StatusContent extends React.PureComponent {
|
||||||
if (this.props.parseClick) {
|
if (this.props.parseClick) {
|
||||||
this.props.parseClick(e, `/tags/${hashtag}`);
|
this.props.parseClick(e, `/tags/${hashtag}`);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = (e) => {
|
handleMouseDown = (e) => {
|
||||||
this.startXY = [e.clientX, e.clientY];
|
this.startXY = [e.clientX, e.clientY];
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseUp = (e) => {
|
handleMouseUp = (e) => {
|
||||||
const { parseClick, disabled } = this.props;
|
const { parseClick, disabled } = this.props;
|
||||||
|
@ -281,7 +281,7 @@ class StatusContent extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.startXY = null;
|
this.startXY = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSpoilerClick = (e) => {
|
handleSpoilerClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -291,15 +291,15 @@ class StatusContent extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.setState({ hidden: !this.state.hidden });
|
this.setState({ hidden: !this.state.hidden });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleTranslate = () => {
|
handleTranslate = () => {
|
||||||
this.props.onTranslate();
|
this.props.onTranslate();
|
||||||
}
|
};
|
||||||
|
|
||||||
setContentsRef = (c) => {
|
setContentsRef = (c) => {
|
||||||
this.contentsNode = c;
|
this.contentsNode = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -21,12 +21,12 @@ export default class StatusHeader extends React.PureComponent {
|
||||||
handleClick = (acct, e) => {
|
handleClick = (acct, e) => {
|
||||||
const { parseClick } = this.props;
|
const { parseClick } = this.props;
|
||||||
parseClick(e, `/@${acct}`);
|
parseClick(e, `/@${acct}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleAccountClick = (e) => {
|
handleAccountClick = (e) => {
|
||||||
const { status } = this.props;
|
const { status } = this.props;
|
||||||
this.handleClick(status.getIn(['account', 'acct']), e);
|
this.handleClick(status.getIn(['account', 'acct']), e);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Rendering.
|
// Rendering.
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class StatusIcons extends React.PureComponent {
|
||||||
setCollapsed(!collapsed);
|
setCollapsed(!collapsed);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
mediaIconTitleText (mediaIcon) {
|
mediaIconTitleText (mediaIcon) {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
|
|
||||||
getFeaturedStatusCount = () => {
|
getFeaturedStatusCount = () => {
|
||||||
return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;
|
return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;
|
||||||
}
|
};
|
||||||
|
|
||||||
getCurrentStatusIndex = (id, featured) => {
|
getCurrentStatusIndex = (id, featured) => {
|
||||||
if (featured) {
|
if (featured) {
|
||||||
|
@ -43,21 +43,21 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();
|
return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMoveUp = (id, featured) => {
|
handleMoveUp = (id, featured) => {
|
||||||
const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;
|
const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;
|
||||||
this._selectChild(elementIndex, true);
|
this._selectChild(elementIndex, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMoveDown = (id, featured) => {
|
handleMoveDown = (id, featured) => {
|
||||||
const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;
|
const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;
|
||||||
this._selectChild(elementIndex, false);
|
this._selectChild(elementIndex, false);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadOlder = debounce(() => {
|
handleLoadOlder = debounce(() => {
|
||||||
this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
|
this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
|
||||||
}, 300, { leading: true })
|
}, 300, { leading: true });
|
||||||
|
|
||||||
_selectChild (index, align_top) {
|
_selectChild (index, align_top) {
|
||||||
const container = this.node.node;
|
const container = this.node.node;
|
||||||
|
@ -75,7 +75,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;
|
const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class StatusPrepend extends React.PureComponent {
|
||||||
handleClick = (e) => {
|
handleClick = (e) => {
|
||||||
const { account, parseClick } = this.props;
|
const { account, parseClick } = this.props;
|
||||||
parseClick(e, `/@${account.get('acct')}`);
|
parseClick(e, `/@${account.get('acct')}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
Message = () => {
|
Message = () => {
|
||||||
const { type, account } = this.props;
|
const { type, account } = this.props;
|
||||||
|
@ -98,7 +98,7 @@ export default class StatusPrepend extends React.PureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { Message } = this;
|
const { Message } = this;
|
||||||
|
@ -126,7 +126,7 @@ export default class StatusPrepend extends React.PureComponent {
|
||||||
case 'update':
|
case 'update':
|
||||||
iconId = 'pencil';
|
iconId = 'pencil';
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
|
|
||||||
return !type ? null : (
|
return !type ? null : (
|
||||||
<aside className={type === 'reblogged_by' || type === 'featured' ? 'status__prepend' : 'notification__message'}>
|
<aside className={type === 'reblogged_by' || type === 'featured' ? 'status__prepend' : 'notification__message'}>
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default class MediaContainer extends PureComponent {
|
||||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||||
|
|
||||||
this.setState({ media, index });
|
this.setState({ media, index });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpenVideo = (options) => {
|
handleOpenVideo = (options) => {
|
||||||
const { components } = this.props;
|
const { components } = this.props;
|
||||||
|
@ -50,7 +50,7 @@ export default class MediaContainer extends PureComponent {
|
||||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||||
|
|
||||||
this.setState({ media: mediaList, options });
|
this.setState({ media: mediaList, options });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleCloseMedia = () => {
|
handleCloseMedia = () => {
|
||||||
document.body.classList.remove('with-modals--active');
|
document.body.classList.remove('with-modals--active');
|
||||||
|
@ -63,11 +63,11 @@ export default class MediaContainer extends PureComponent {
|
||||||
backgroundColor: null,
|
backgroundColor: null,
|
||||||
options: null,
|
options: null,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
setBackgroundColor = color => {
|
setBackgroundColor = color => {
|
||||||
this.setState({ backgroundColor: color });
|
this.setState({ backgroundColor: color });
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { locale, components } = this.props;
|
const { locale, components } = this.props;
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Section extends React.PureComponent {
|
||||||
const { collapsed } = this.state;
|
const { collapsed } = this.state;
|
||||||
|
|
||||||
this.setState({ collapsed: !collapsed }, () => onOpen && onOpen());
|
this.setState({ collapsed: !collapsed }, () => onOpen && onOpen());
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { title, children } = this.props;
|
const { title, children } = this.props;
|
||||||
|
@ -106,7 +106,7 @@ class About extends React.PureComponent {
|
||||||
handleDomainBlocksOpen = () => {
|
handleDomainBlocksOpen = () => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
dispatch(fetchDomainBlocks());
|
dispatch(fetchDomainBlocks());
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { multiColumn, intl, server, extendedDescription, domainBlocks } = this.props;
|
const { multiColumn, intl, server, extendedDescription, domainBlocks } = this.props;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Header extends ImmutablePureComponent {
|
||||||
} else if (e.keyCode === 27) {
|
} else if (e.keyCode === 27) {
|
||||||
this.props.onCancelAccountNote();
|
this.props.onCancelAccountNote();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { account, accountNote, isEditing, isSubmitting, intl } = this.props;
|
const { account, accountNote, isEditing, isSubmitting, intl } = this.props;
|
||||||
|
|
|
@ -21,7 +21,7 @@ class ActionBar extends React.PureComponent {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return !location.pathname.match(/\/(followers|following)\/?$/);
|
return !location.pathname.match(/\/(followers|following)\/?$/);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { account, intl } = this.props;
|
const { account, intl } = this.props;
|
||||||
|
@ -32,7 +32,7 @@ class ActionBar extends React.PureComponent {
|
||||||
<div className='account__disclaimer'>
|
<div className='account__disclaimer'>
|
||||||
<Icon id='info-circle' fixedWidth /> <FormattedMessage
|
<Icon id='info-circle' fixedWidth /> <FormattedMessage
|
||||||
id='account.suspended_disclaimer_full'
|
id='account.suspended_disclaimer_full'
|
||||||
defaultMessage="This user has been suspended by a moderator."
|
defaultMessage='This user has been suspended by a moderator.'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -109,7 +109,7 @@ class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
openEditProfile = () => {
|
openEditProfile = () => {
|
||||||
window.open(profileLink, '_blank');
|
window.open(profileLink, '_blank');
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseEnter = ({ currentTarget }) => {
|
handleMouseEnter = ({ currentTarget }) => {
|
||||||
if (autoPlayGif) {
|
if (autoPlayGif) {
|
||||||
|
@ -122,7 +122,7 @@ class Header extends ImmutablePureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-original');
|
emoji.src = emoji.getAttribute('data-original');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = ({ currentTarget }) => {
|
handleMouseLeave = ({ currentTarget }) => {
|
||||||
if (autoPlayGif) {
|
if (autoPlayGif) {
|
||||||
|
@ -135,14 +135,14 @@ class Header extends ImmutablePureComponent {
|
||||||
let emoji = emojis[i];
|
let emoji = emojis[i];
|
||||||
emoji.src = emoji.getAttribute('data-static');
|
emoji.src = emoji.getAttribute('data-static');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleAvatarClick = e => {
|
handleAvatarClick = e => {
|
||||||
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onOpenAvatar();
|
this.props.onOpenAvatar();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleShare = () => {
|
handleShare = () => {
|
||||||
const { account } = this.props;
|
const { account } = this.props;
|
||||||
|
@ -153,7 +153,7 @@ class Header extends ImmutablePureComponent {
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
if (e.name !== 'AbortError') console.error(e);
|
if (e.name !== 'AbortError') console.error(e);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { account, hidden, intl, domain } = this.props;
|
const { account, hidden, intl, domain } = this.props;
|
||||||
|
@ -177,8 +177,7 @@ class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {
|
if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {
|
||||||
info.push(<span className='relationship-tag'><FormattedMessage id='account.follows_you' defaultMessage='Follows you' /></span>);
|
info.push(<span className='relationship-tag'><FormattedMessage id='account.follows_you' defaultMessage='Follows you' /></span>);
|
||||||
}
|
} else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {
|
||||||
else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {
|
|
||||||
info.push(<span className='relationship-tag'><FormattedMessage id='account.blocked' defaultMessage='Blocked' /></span>);
|
info.push(<span className='relationship-tag'><FormattedMessage id='account.blocked' defaultMessage='Blocked' /></span>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,20 +22,20 @@ export default class MediaItem extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleImageLoad = () => {
|
handleImageLoad = () => {
|
||||||
this.setState({ loaded: true });
|
this.setState({ loaded: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseEnter = e => {
|
handleMouseEnter = e => {
|
||||||
if (this.hoverToPlay()) {
|
if (this.hoverToPlay()) {
|
||||||
e.target.play();
|
e.target.play();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = e => {
|
handleMouseLeave = e => {
|
||||||
if (this.hoverToPlay()) {
|
if (this.hoverToPlay()) {
|
||||||
e.target.pause();
|
e.target.pause();
|
||||||
e.target.currentTime = 0;
|
e.target.currentTime = 0;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
hoverToPlay () {
|
hoverToPlay () {
|
||||||
return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1;
|
return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1;
|
||||||
|
@ -51,7 +51,7 @@ export default class MediaItem extends ImmutablePureComponent {
|
||||||
this.setState({ visible: true });
|
this.setState({ visible: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { attachment, displayWidth } = this.props;
|
const { attachment, displayWidth } = this.props;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LoadMoreMedia extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleLoadMore = () => {
|
handleLoadMore = () => {
|
||||||
this.props.onLoadMore(this.props.maxId);
|
this.props.onLoadMore(this.props.maxId);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
|
@ -109,13 +109,13 @@ class AccountGallery extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleHeaderClick = () => {
|
handleHeaderClick = () => {
|
||||||
this.column.scrollTop();
|
this.column.scrollTop();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleScrollToBottom = () => {
|
handleScrollToBottom = () => {
|
||||||
if (this.props.hasMore) {
|
if (this.props.hasMore) {
|
||||||
this.handleLoadMore(this.props.attachments.size > 0 ? this.props.attachments.last().getIn(['status', 'id']) : undefined);
|
this.handleLoadMore(this.props.attachments.size > 0 ? this.props.attachments.last().getIn(['status', 'id']) : undefined);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleScroll = e => {
|
handleScroll = e => {
|
||||||
const { scrollTop, scrollHeight, clientHeight } = e.target;
|
const { scrollTop, scrollHeight, clientHeight } = e.target;
|
||||||
|
@ -124,7 +124,7 @@ class AccountGallery extends ImmutablePureComponent {
|
||||||
if (150 > offset && !this.props.isLoading) {
|
if (150 > offset && !this.props.isLoading) {
|
||||||
this.handleScrollToBottom();
|
this.handleScrollToBottom();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadMore = maxId => {
|
handleLoadMore = maxId => {
|
||||||
this.props.dispatch(expandAccountMediaTimeline(this.props.accountId, { maxId }));
|
this.props.dispatch(expandAccountMediaTimeline(this.props.accountId, { maxId }));
|
||||||
|
@ -133,11 +133,11 @@ class AccountGallery extends ImmutablePureComponent {
|
||||||
handleLoadOlder = e => {
|
handleLoadOlder = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.handleScrollToBottom();
|
this.handleScrollToBottom();
|
||||||
}
|
};
|
||||||
|
|
||||||
setColumnRef = c => {
|
setColumnRef = c => {
|
||||||
this.column = c;
|
this.column = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpenMedia = attachment => {
|
handleOpenMedia = attachment => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
|
@ -153,13 +153,13 @@ class AccountGallery extends ImmutablePureComponent {
|
||||||
|
|
||||||
dispatch(openModal('MEDIA', { media, index, statusId }));
|
dispatch(openModal('MEDIA', { media, index, statusId }));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleRef = c => {
|
handleRef = c => {
|
||||||
if (c) {
|
if (c) {
|
||||||
this.setState({ width: c.offsetWidth });
|
this.setState({ width: c.offsetWidth });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { attachments, isLoading, hasMore, isAccount, multiColumn, suspended } = this.props;
|
const { attachments, isLoading, hasMore, isAccount, multiColumn, suspended } = this.props;
|
||||||
|
|
|
@ -37,35 +37,35 @@ export default class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleFollow = () => {
|
handleFollow = () => {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlock = () => {
|
handleBlock = () => {
|
||||||
this.props.onBlock(this.props.account);
|
this.props.onBlock(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMention = () => {
|
handleMention = () => {
|
||||||
this.props.onMention(this.props.account, this.context.router.history);
|
this.props.onMention(this.props.account, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleDirect = () => {
|
handleDirect = () => {
|
||||||
this.props.onDirect(this.props.account, this.context.router.history);
|
this.props.onDirect(this.props.account, this.context.router.history);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReport = () => {
|
handleReport = () => {
|
||||||
this.props.onReport(this.props.account);
|
this.props.onReport(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReblogToggle = () => {
|
handleReblogToggle = () => {
|
||||||
this.props.onReblogToggle(this.props.account);
|
this.props.onReblogToggle(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleNotifyToggle = () => {
|
handleNotifyToggle = () => {
|
||||||
this.props.onNotifyToggle(this.props.account);
|
this.props.onNotifyToggle(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMute = () => {
|
handleMute = () => {
|
||||||
this.props.onMute(this.props.account);
|
this.props.onMute(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlockDomain = () => {
|
handleBlockDomain = () => {
|
||||||
const domain = this.props.account.get('acct').split('@')[1];
|
const domain = this.props.account.get('acct').split('@')[1];
|
||||||
|
@ -73,7 +73,7 @@ export default class Header extends ImmutablePureComponent {
|
||||||
if (!domain) return;
|
if (!domain) return;
|
||||||
|
|
||||||
this.props.onBlockDomain(domain);
|
this.props.onBlockDomain(domain);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleUnblockDomain = () => {
|
handleUnblockDomain = () => {
|
||||||
const domain = this.props.account.get('acct').split('@')[1];
|
const domain = this.props.account.get('acct').split('@')[1];
|
||||||
|
@ -81,31 +81,31 @@ export default class Header extends ImmutablePureComponent {
|
||||||
if (!domain) return;
|
if (!domain) return;
|
||||||
|
|
||||||
this.props.onUnblockDomain(domain);
|
this.props.onUnblockDomain(domain);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleEndorseToggle = () => {
|
handleEndorseToggle = () => {
|
||||||
this.props.onEndorseToggle(this.props.account);
|
this.props.onEndorseToggle(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleAddToList = () => {
|
handleAddToList = () => {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleEditAccountNote = () => {
|
handleEditAccountNote = () => {
|
||||||
this.props.onEditAccountNote(this.props.account);
|
this.props.onEditAccountNote(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleChangeLanguages = () => {
|
handleChangeLanguages = () => {
|
||||||
this.props.onChangeLanguages(this.props.account);
|
this.props.onChangeLanguages(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleInteractionModal = () => {
|
handleInteractionModal = () => {
|
||||||
this.props.onInteractionModal(this.props.account);
|
this.props.onInteractionModal(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOpenAvatar = () => {
|
handleOpenAvatar = () => {
|
||||||
this.props.onOpenAvatar(this.props.account);
|
this.props.onOpenAvatar(this.props.account);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { account, hidden, hideTabs } = this.props;
|
const { account, hidden, hideTabs } = this.props;
|
||||||
|
|
|
@ -20,7 +20,7 @@ class LimitedAccountHint extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
accountId: PropTypes.string.isRequired,
|
accountId: PropTypes.string.isRequired,
|
||||||
reveal: PropTypes.func,
|
reveal: PropTypes.func,
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { reveal } = this.props;
|
const { reveal } = this.props;
|
||||||
|
|
|
@ -21,13 +21,13 @@ export default class MovedNote extends ImmutablePureComponent {
|
||||||
handleAccountClick = e => {
|
handleAccountClick = e => {
|
||||||
if (e.button === 0) {
|
if (e.button === 0) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let state = {...this.context.router.history.location.state};
|
let state = { ...this.context.router.history.location.state };
|
||||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||||
this.context.router.history.push(`/@${this.props.to.get('acct')}`, state);
|
this.context.router.history.push(`/@${this.props.to.get('acct')}`, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { from, to } = this.props;
|
const { from, to } = this.props;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
} from 'flavours/glitch/actions/accounts';
|
} from 'flavours/glitch/actions/accounts';
|
||||||
import {
|
import {
|
||||||
mentionCompose,
|
mentionCompose,
|
||||||
directCompose
|
directCompose,
|
||||||
} from 'flavours/glitch/actions/compose';
|
} from 'flavours/glitch/actions/compose';
|
||||||
import { initMuteModal } from 'flavours/glitch/actions/mutes';
|
import { initMuteModal } from 'flavours/glitch/actions/mutes';
|
||||||
import { initBlockModal } from 'flavours/glitch/actions/blocks';
|
import { initBlockModal } from 'flavours/glitch/actions/blocks';
|
||||||
|
|
|
@ -140,15 +140,15 @@ class AccountTimeline extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleHeaderClick = () => {
|
handleHeaderClick = () => {
|
||||||
this.column.scrollTop();
|
this.column.scrollTop();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadMore = maxId => {
|
handleLoadMore = maxId => {
|
||||||
this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged }));
|
this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged }));
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.column = c;
|
this.column = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;
|
const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;
|
||||||
|
|
|
@ -75,7 +75,7 @@ class Audio extends React.PureComponent {
|
||||||
if (this.player) {
|
if (this.player) {
|
||||||
this._setDimensions();
|
this._setDimensions();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
_pack() {
|
_pack() {
|
||||||
return {
|
return {
|
||||||
|
@ -107,11 +107,11 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
setSeekRef = c => {
|
setSeekRef = c => {
|
||||||
this.seek = c;
|
this.seek = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setVolumeRef = c => {
|
setVolumeRef = c => {
|
||||||
this.volume = c;
|
this.volume = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setAudioRef = c => {
|
setAudioRef = c => {
|
||||||
this.audio = c;
|
this.audio = c;
|
||||||
|
@ -120,13 +120,13 @@ class Audio extends React.PureComponent {
|
||||||
this.audio.volume = 1;
|
this.audio.volume = 1;
|
||||||
this.audio.muted = false;
|
this.audio.muted = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setCanvasRef = c => {
|
setCanvasRef = c => {
|
||||||
this.canvas = c;
|
this.canvas = c;
|
||||||
|
|
||||||
this.visualizer.setCanvas(c);
|
this.visualizer.setCanvas(c);
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
window.addEventListener('scroll', this.handleScroll);
|
window.addEventListener('scroll', this.handleScroll);
|
||||||
|
@ -169,7 +169,7 @@ class Audio extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.setState({ paused: true }, () => this.audio.pause());
|
this.setState({ paused: true }, () => this.audio.pause());
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleResize = debounce(() => {
|
handleResize = debounce(() => {
|
||||||
if (this.player) {
|
if (this.player) {
|
||||||
|
@ -187,7 +187,7 @@ class Audio extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._renderCanvas();
|
this._renderCanvas();
|
||||||
}
|
};
|
||||||
|
|
||||||
handlePause = () => {
|
handlePause = () => {
|
||||||
this.setState({ paused: true });
|
this.setState({ paused: true });
|
||||||
|
@ -195,7 +195,7 @@ class Audio extends React.PureComponent {
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
this.audioContext.suspend();
|
this.audioContext.suspend();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleProgress = () => {
|
handleProgress = () => {
|
||||||
const lastTimeRange = this.audio.buffered.length - 1;
|
const lastTimeRange = this.audio.buffered.length - 1;
|
||||||
|
@ -203,7 +203,7 @@ class Audio extends React.PureComponent {
|
||||||
if (lastTimeRange > -1) {
|
if (lastTimeRange > -1) {
|
||||||
this.setState({ buffer: Math.ceil(this.audio.buffered.end(lastTimeRange) / this.audio.duration * 100) });
|
this.setState({ buffer: Math.ceil(this.audio.buffered.end(lastTimeRange) / this.audio.duration * 100) });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
toggleMute = () => {
|
toggleMute = () => {
|
||||||
const muted = !this.state.muted;
|
const muted = !this.state.muted;
|
||||||
|
@ -213,7 +213,7 @@ class Audio extends React.PureComponent {
|
||||||
this.gainNode.gain.value = muted ? 0 : this.state.volume;
|
this.gainNode.gain.value = muted ? 0 : this.state.volume;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
toggleReveal = () => {
|
toggleReveal = () => {
|
||||||
if (this.props.onToggleVisibility) {
|
if (this.props.onToggleVisibility) {
|
||||||
|
@ -221,7 +221,7 @@ class Audio extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.setState({ revealed: !this.state.revealed });
|
this.setState({ revealed: !this.state.revealed });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleVolumeMouseDown = e => {
|
handleVolumeMouseDown = e => {
|
||||||
document.addEventListener('mousemove', this.handleMouseVolSlide, true);
|
document.addEventListener('mousemove', this.handleMouseVolSlide, true);
|
||||||
|
@ -233,14 +233,14 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleVolumeMouseUp = () => {
|
handleVolumeMouseUp = () => {
|
||||||
document.removeEventListener('mousemove', this.handleMouseVolSlide, true);
|
document.removeEventListener('mousemove', this.handleMouseVolSlide, true);
|
||||||
document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);
|
document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);
|
||||||
document.removeEventListener('touchmove', this.handleMouseVolSlide, true);
|
document.removeEventListener('touchmove', this.handleMouseVolSlide, true);
|
||||||
document.removeEventListener('touchend', this.handleVolumeMouseUp, true);
|
document.removeEventListener('touchend', this.handleVolumeMouseUp, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = e => {
|
handleMouseDown = e => {
|
||||||
document.addEventListener('mousemove', this.handleMouseMove, true);
|
document.addEventListener('mousemove', this.handleMouseMove, true);
|
||||||
|
@ -254,7 +254,7 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseUp = () => {
|
handleMouseUp = () => {
|
||||||
document.removeEventListener('mousemove', this.handleMouseMove, true);
|
document.removeEventListener('mousemove', this.handleMouseMove, true);
|
||||||
|
@ -264,7 +264,7 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
this.setState({ dragging: false });
|
this.setState({ dragging: false });
|
||||||
this.audio.play();
|
this.audio.play();
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseMove = throttle(e => {
|
handleMouseMove = throttle(e => {
|
||||||
const { x } = getPointerPosition(this.seek, e);
|
const { x } = getPointerPosition(this.seek, e);
|
||||||
|
@ -282,7 +282,7 @@ class Audio extends React.PureComponent {
|
||||||
currentTime: this.audio.currentTime,
|
currentTime: this.audio.currentTime,
|
||||||
duration: this.audio.duration,
|
duration: this.audio.duration,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseVolSlide = throttle(e => {
|
handleMouseVolSlide = throttle(e => {
|
||||||
const { x } = getPointerPosition(this.volume, e);
|
const { x } = getPointerPosition(this.volume, e);
|
||||||
|
@ -317,11 +317,11 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
handleMouseEnter = () => {
|
handleMouseEnter = () => {
|
||||||
this.setState({ hovered: true });
|
this.setState({ hovered: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseLeave = () => {
|
handleMouseLeave = () => {
|
||||||
this.setState({ hovered: false });
|
this.setState({ hovered: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadedData = () => {
|
handleLoadedData = () => {
|
||||||
const { autoPlay, currentTime } = this.props;
|
const { autoPlay, currentTime } = this.props;
|
||||||
|
@ -333,7 +333,7 @@ class Audio extends React.PureComponent {
|
||||||
if (autoPlay) {
|
if (autoPlay) {
|
||||||
this.togglePlay();
|
this.togglePlay();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
_initAudioContext () {
|
_initAudioContext () {
|
||||||
const AudioContext = window.AudioContext || window.webkitAudioContext;
|
const AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||||
|
@ -367,7 +367,7 @@ class Audio extends React.PureComponent {
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
_renderCanvas () {
|
_renderCanvas () {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
|
@ -438,7 +438,7 @@ class Audio extends React.PureComponent {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.togglePlay();
|
this.togglePlay();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
switch(e.key) {
|
switch(e.key) {
|
||||||
|
@ -463,7 +463,7 @@ class Audio extends React.PureComponent {
|
||||||
this.seekBy(10);
|
this.seekBy(10);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { src, intl, alt, editable, autoPlay, sensitive, blurhash } = this.props;
|
const { src, intl, alt, editable, autoPlay, sensitive, blurhash } = this.props;
|
||||||
|
|
|
@ -48,24 +48,24 @@ class Bookmarks extends ImmutablePureComponent {
|
||||||
} else {
|
} else {
|
||||||
dispatch(addColumn('BOOKMARKS', {}));
|
dispatch(addColumn('BOOKMARKS', {}));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMove = (dir) => {
|
handleMove = (dir) => {
|
||||||
const { columnId, dispatch } = this.props;
|
const { columnId, dispatch } = this.props;
|
||||||
dispatch(moveColumn(columnId, dir));
|
dispatch(moveColumn(columnId, dir));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHeaderClick = () => {
|
handleHeaderClick = () => {
|
||||||
this.column.scrollTop();
|
this.column.scrollTop();
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.column = c;
|
this.column = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadMore = debounce(() => {
|
handleLoadMore = debounce(() => {
|
||||||
this.props.dispatch(expandBookmarkedStatuses());
|
this.props.dispatch(expandBookmarkedStatuses());
|
||||||
}, 300, { leading: true })
|
}, 300, { leading: true });
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
|
const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
|
||||||
|
|
|
@ -72,4 +72,4 @@ class ClosedRegistrationsModal extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
|
@ -63,16 +63,16 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
dispatch(addColumn('COMMUNITY', { other: { onlyMedia } }));
|
dispatch(addColumn('COMMUNITY', { other: { onlyMedia } }));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMove = (dir) => {
|
handleMove = (dir) => {
|
||||||
const { columnId, dispatch } = this.props;
|
const { columnId, dispatch } = this.props;
|
||||||
dispatch(moveColumn(columnId, dir));
|
dispatch(moveColumn(columnId, dir));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleHeaderClick = () => {
|
handleHeaderClick = () => {
|
||||||
this.column.scrollTop();
|
this.column.scrollTop();
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
const { dispatch, onlyMedia } = this.props;
|
const { dispatch, onlyMedia } = this.props;
|
||||||
|
@ -112,13 +112,13 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.column = c;
|
this.column = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleLoadMore = maxId => {
|
handleLoadMore = maxId => {
|
||||||
const { dispatch, onlyMedia } = this.props;
|
const { dispatch, onlyMedia } = this.props;
|
||||||
|
|
||||||
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
|
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
|
const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
|
||||||
|
|
|
@ -32,7 +32,7 @@ class ActionBar extends React.PureComponent {
|
||||||
|
|
||||||
handleLogout = () => {
|
handleLogout = () => {
|
||||||
this.props.onLogout();
|
this.props.onLogout();
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
|
|
@ -83,22 +83,22 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleChange = (e) => {
|
handleChange = (e) => {
|
||||||
this.props.onChange(e.target.value);
|
this.props.onChange(e.target.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
getFulltextForCharacterCounting = () => {
|
getFulltextForCharacterCounting = () => {
|
||||||
return [
|
return [
|
||||||
this.props.spoiler? this.props.spoilerText: '',
|
this.props.spoiler? this.props.spoilerText: '',
|
||||||
countableText(this.props.text),
|
countableText(this.props.text),
|
||||||
this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : ''
|
this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : '',
|
||||||
].join('');
|
].join('');
|
||||||
}
|
};
|
||||||
|
|
||||||
canSubmit = () => {
|
canSubmit = () => {
|
||||||
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
|
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
|
||||||
const fulltext = this.getFulltextForCharacterCounting();
|
const fulltext = this.getFulltextForCharacterCounting();
|
||||||
|
|
||||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (!fulltext.trim().length && !anyMedia));
|
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (!fulltext.trim().length && !anyMedia));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSubmit = (overriddenVisibility = null) => {
|
handleSubmit = (overriddenVisibility = null) => {
|
||||||
const {
|
const {
|
||||||
|
@ -129,7 +129,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
onSubmit(this.context.router ? this.context.router.history : null);
|
onSubmit(this.context.router ? this.context.router.history : null);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Changes the text value of the spoiler.
|
// Changes the text value of the spoiler.
|
||||||
handleChangeSpoiler = ({ target: { value } }) => {
|
handleChangeSpoiler = ({ target: { value } }) => {
|
||||||
|
@ -137,7 +137,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
if (onChangeSpoilerText) {
|
if (onChangeSpoilerText) {
|
||||||
onChangeSpoilerText(value);
|
onChangeSpoilerText(value);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.composeForm = c;
|
this.composeForm = c;
|
||||||
|
@ -150,7 +150,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
if (onPickEmoji) {
|
if (onPickEmoji) {
|
||||||
onPickEmoji(selectionStart, data);
|
onPickEmoji(selectionStart, data);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Handles the secondary submit button.
|
// Handles the secondary submit button.
|
||||||
handleSecondarySubmit = () => {
|
handleSecondarySubmit = () => {
|
||||||
|
@ -158,16 +158,16 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
sideArm,
|
sideArm,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
this.handleSubmit(sideArm === 'none' ? null : sideArm);
|
this.handleSubmit(sideArm === 'none' ? null : sideArm);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Selects a suggestion from the autofill.
|
// Selects a suggestion from the autofill.
|
||||||
onSuggestionSelected = (tokenStart, token, value) => {
|
onSuggestionSelected = (tokenStart, token, value) => {
|
||||||
this.props.onSuggestionSelected(tokenStart, token, value, ['text']);
|
this.props.onSuggestionSelected(tokenStart, token, value, ['text']);
|
||||||
}
|
};
|
||||||
|
|
||||||
onSpoilerSuggestionSelected = (tokenStart, token, value) => {
|
onSpoilerSuggestionSelected = (tokenStart, token, value) => {
|
||||||
this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']);
|
this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
|
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
|
||||||
|
@ -177,21 +177,21 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
if (e.keyCode == 13 && e.altKey) {
|
if (e.keyCode == 13 && e.altKey) {
|
||||||
this.handleSecondarySubmit();
|
this.handleSecondarySubmit();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Sets a reference to the textarea.
|
// Sets a reference to the textarea.
|
||||||
setAutosuggestTextarea = (textareaComponent) => {
|
setAutosuggestTextarea = (textareaComponent) => {
|
||||||
if (textareaComponent) {
|
if (textareaComponent) {
|
||||||
this.textarea = textareaComponent.textarea;
|
this.textarea = textareaComponent.textarea;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Sets a reference to the CW field.
|
// Sets a reference to the CW field.
|
||||||
handleRefSpoilerText = (spoilerComponent) => {
|
handleRefSpoilerText = (spoilerComponent) => {
|
||||||
if (spoilerComponent) {
|
if (spoilerComponent) {
|
||||||
this.spoilerText = spoilerComponent.input;
|
this.spoilerText = spoilerComponent.input;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFocus = () => {
|
handleFocus = () => {
|
||||||
if (this.composeForm && !this.props.singleColumn) {
|
if (this.composeForm && !this.props.singleColumn) {
|
||||||
|
@ -200,7 +200,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
this.composeForm.scrollIntoView();
|
this.composeForm.scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this._updateFocusAndSelection({ });
|
this._updateFocusAndSelection({ });
|
||||||
|
@ -271,7 +271,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
|
||||||
}
|
}
|
||||||
this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' });
|
this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
|
@ -72,13 +72,13 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = () => {
|
handleMouseDown = () => {
|
||||||
if (!this.state.open) {
|
if (!this.state.open) {
|
||||||
this.activeElement = document.activeElement;
|
this.activeElement = document.activeElement;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleButtonKeyDown = (e) => {
|
handleButtonKeyDown = (e) => {
|
||||||
switch(e.key) {
|
switch(e.key) {
|
||||||
|
@ -87,7 +87,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
|
||||||
this.handleMouseDown();
|
this.handleMouseDown();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
switch(e.key) {
|
switch(e.key) {
|
||||||
|
@ -98,14 +98,14 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClose = () => {
|
handleClose = () => {
|
||||||
if (this.state.open && this.activeElement) {
|
if (this.state.open && this.activeElement) {
|
||||||
this.activeElement.focus({ preventScroll: true });
|
this.activeElement.focus({ preventScroll: true });
|
||||||
}
|
}
|
||||||
this.setState({ open: false });
|
this.setState({ open: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleItemClick = (e) => {
|
handleItemClick = (e) => {
|
||||||
const {
|
const {
|
||||||
|
@ -151,22 +151,22 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
|
||||||
...rest,
|
...rest,
|
||||||
active: value && name === value,
|
active: value && name === value,
|
||||||
name,
|
name,
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
setTargetRef = c => {
|
setTargetRef = c => {
|
||||||
this.target = c;
|
this.target = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
findTarget = () => {
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOverlayEnter = (state) => {
|
handleOverlayEnter = (state) => {
|
||||||
this.setState({ placement: state.placement });
|
this.setState({ placement: state.placement });
|
||||||
}
|
};
|
||||||
|
|
||||||
// Rendering.
|
// Rendering.
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -44,12 +44,12 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
|
||||||
if (this.node && !this.node.contains(e.target)) {
|
if (this.node && !this.node.contains(e.target)) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Stores our node in `this.node`.
|
// Stores our node in `this.node`.
|
||||||
setRef = (node) => {
|
setRef = (node) => {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
};
|
||||||
|
|
||||||
// On mounting, we add our listeners.
|
// On mounting, we add our listeners.
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
@ -84,7 +84,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
onChange(name);
|
onChange(name);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Handle changes differently whether the dropdown is a list of options or actions
|
// Handle changes differently whether the dropdown is a list of options or actions
|
||||||
handleChange = (name) => {
|
handleChange = (name) => {
|
||||||
|
@ -93,7 +93,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
|
||||||
} else {
|
} else {
|
||||||
this.setState({ value: name });
|
this.setState({ value: name });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
const index = Number(e.currentTarget.getAttribute('data-index'));
|
const index = Number(e.currentTarget.getAttribute('data-index'));
|
||||||
|
@ -135,11 +135,11 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setFocusRef = c => {
|
setFocusRef = c => {
|
||||||
this.focusedItem = c;
|
this.focusedItem = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
renderItem = (item, i) => {
|
renderItem = (item, i) => {
|
||||||
const { name, icon, meta, text } = item;
|
const { name, icon, meta, text } = item;
|
||||||
|
@ -177,7 +177,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
|
||||||
{contents}
|
{contents}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Rendering.
|
// Rendering.
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -58,7 +58,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
||||||
|
|
||||||
handleClick = e => {
|
handleClick = e => {
|
||||||
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
|
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.active) {
|
if (nextProps.active) {
|
||||||
|
@ -76,7 +76,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
||||||
if (this.node && !this.node.contains(e.target)) {
|
if (this.node && !this.node.contains(e.target)) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
attachListeners () {
|
attachListeners () {
|
||||||
document.addEventListener('click', this.handleDocumentClick, false);
|
document.addEventListener('click', this.handleDocumentClick, false);
|
||||||
|
@ -90,7 +90,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { active } = this.props;
|
const { active } = this.props;
|
||||||
|
@ -125,12 +125,12 @@ class ModifierPicker extends React.PureComponent {
|
||||||
} else {
|
} else {
|
||||||
this.props.onOpen();
|
this.props.onOpen();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSelect = modifier => {
|
handleSelect = modifier => {
|
||||||
this.props.onChange(modifier);
|
this.props.onChange(modifier);
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { active, modifier } = this.props;
|
const { active, modifier } = this.props;
|
||||||
|
@ -175,7 +175,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
||||||
if (this.node && !this.node.contains(e.target)) {
|
if (this.node && !this.node.contains(e.target)) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
document.addEventListener('click', this.handleDocumentClick, false);
|
document.addEventListener('click', this.handleDocumentClick, false);
|
||||||
|
@ -199,7 +199,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
getI18n = () => {
|
getI18n = () => {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
@ -220,7 +220,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
||||||
custom: intl.formatMessage(messages.custom),
|
custom: intl.formatMessage(messages.custom),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClick = (emoji, event) => {
|
handleClick = (emoji, event) => {
|
||||||
if (!emoji.native) {
|
if (!emoji.native) {
|
||||||
|
@ -230,19 +230,19 @@ class EmojiPickerMenu extends React.PureComponent {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
this.props.onPick(emoji);
|
this.props.onPick(emoji);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleModifierOpen = () => {
|
handleModifierOpen = () => {
|
||||||
this.setState({ modifierOpen: true });
|
this.setState({ modifierOpen: true });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleModifierClose = () => {
|
handleModifierClose = () => {
|
||||||
this.setState({ modifierOpen: false });
|
this.setState({ modifierOpen: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleModifierChange = modifier => {
|
handleModifierChange = modifier => {
|
||||||
this.props.onSkinTone(modifier);
|
this.props.onSkinTone(modifier);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;
|
const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;
|
||||||
|
@ -327,7 +327,7 @@ class EmojiPickerDropdown extends React.PureComponent {
|
||||||
|
|
||||||
setRef = (c) => {
|
setRef = (c) => {
|
||||||
this.dropdown = c;
|
this.dropdown = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
onShowDropdown = () => {
|
onShowDropdown = () => {
|
||||||
this.setState({ active: true });
|
this.setState({ active: true });
|
||||||
|
@ -344,11 +344,11 @@ class EmojiPickerDropdown extends React.PureComponent {
|
||||||
this.setState({ loading: false, active: false });
|
this.setState({ loading: false, active: false });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onHideDropdown = () => {
|
onHideDropdown = () => {
|
||||||
this.setState({ active: false });
|
this.setState({ active: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
onToggle = (e) => {
|
onToggle = (e) => {
|
||||||
if (!this.state.loading && (!e.key || e.key === 'Enter')) {
|
if (!this.state.loading && (!e.key || e.key === 'Enter')) {
|
||||||
|
@ -358,21 +358,21 @@ class EmojiPickerDropdown extends React.PureComponent {
|
||||||
this.onShowDropdown(e);
|
this.onShowDropdown(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
this.onHideDropdown();
|
this.onHideDropdown();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setTargetRef = c => {
|
setTargetRef = c => {
|
||||||
this.target = c;
|
this.target = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
findTarget = () => {
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis, button } = this.props;
|
const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis, button } = this.props;
|
||||||
|
|
|
@ -47,6 +47,7 @@ const messages = defineMessages({
|
||||||
|
|
||||||
export default @injectIntl
|
export default @injectIntl
|
||||||
class Header extends ImmutablePureComponent {
|
class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
columns: ImmutablePropTypes.list,
|
columns: ImmutablePropTypes.list,
|
||||||
unreadNotifications: PropTypes.number,
|
unreadNotifications: PropTypes.number,
|
||||||
|
@ -63,7 +64,7 @@ class Header extends ImmutablePureComponent {
|
||||||
this.props.onLogout();
|
this.props.onLogout();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, columns, unreadNotifications, showNotificationsBadge, onSettingsClick } = this.props;
|
const { intl, columns, unreadNotifications, showNotificationsBadge, onSettingsClick } = this.props;
|
||||||
|
@ -71,8 +72,8 @@ class Header extends ImmutablePureComponent {
|
||||||
// Only renders the component if the column isn't being shown.
|
// Only renders the component if the column isn't being shown.
|
||||||
const renderForColumn = conditionalRender.bind(null,
|
const renderForColumn = conditionalRender.bind(null,
|
||||||
columnId => !columns || !columns.some(
|
columnId => !columns || !columns.some(
|
||||||
column => column.get('id') === columnId
|
column => column.get('id') === columnId,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// The result.
|
// The result.
|
||||||
|
@ -125,10 +126,11 @@ class Header extends ImmutablePureComponent {
|
||||||
<a
|
<a
|
||||||
aria-label={intl.formatMessage(messages.logout)}
|
aria-label={intl.formatMessage(messages.logout)}
|
||||||
onClick={this.handleLogoutClick}
|
onClick={this.handleLogoutClick}
|
||||||
href={ signOutLink }
|
href={signOutLink}
|
||||||
title={intl.formatMessage(messages.logout)}
|
title={intl.formatMessage(messages.logout)}
|
||||||
><Icon id='sign-out' /></a>
|
><Icon id='sign-out' /></a>
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
if (this.node && !this.node.contains(e.target)) {
|
if (this.node && !this.node.contains(e.target)) {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
document.addEventListener('click', this.handleDocumentClick, false);
|
document.addEventListener('click', this.handleDocumentClick, false);
|
||||||
|
@ -63,15 +63,15 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setListRef = c => {
|
setListRef = c => {
|
||||||
this.listNode = c;
|
this.listNode = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSearchChange = ({ target }) => {
|
handleSearchChange = ({ target }) => {
|
||||||
this.setState({ searchValue: target.value });
|
this.setState({ searchValue: target.value });
|
||||||
}
|
};
|
||||||
|
|
||||||
search () {
|
search () {
|
||||||
const { languages, value, frequentlyUsedLanguages } = this.props;
|
const { languages, value, frequentlyUsedLanguages } = this.props;
|
||||||
|
@ -122,7 +122,7 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
|
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
this.props.onChange(value);
|
this.props.onChange(value);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
const { onClose } = this.props;
|
const { onClose } = this.props;
|
||||||
|
@ -163,7 +163,7 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSearchKeyDown = e => {
|
handleSearchKeyDown = e => {
|
||||||
const { onChange, onClose } = this.props;
|
const { onChange, onClose } = this.props;
|
||||||
|
@ -199,11 +199,11 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClear = () => {
|
handleClear = () => {
|
||||||
this.setState({ searchValue: '' });
|
this.setState({ searchValue: '' });
|
||||||
}
|
};
|
||||||
|
|
||||||
renderItem = lang => {
|
renderItem = lang => {
|
||||||
const { value } = this.props;
|
const { value } = this.props;
|
||||||
|
@ -213,7 +213,7 @@ class LanguageDropdownMenu extends React.PureComponent {
|
||||||
<span className='language-dropdown__dropdown__results__item__native-name'>{lang[2]}</span> <span className='language-dropdown__dropdown__results__item__common-name'>({lang[1]})</span>
|
<span className='language-dropdown__dropdown__results__item__native-name'>{lang[2]}</span> <span className='language-dropdown__dropdown__results__item__common-name'>({lang[1]})</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
@ -259,7 +259,7 @@ class LanguageDropdown extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ open: !this.state.open });
|
this.setState({ open: !this.state.open });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClose = () => {
|
handleClose = () => {
|
||||||
const { value, onClose } = this.props;
|
const { value, onClose } = this.props;
|
||||||
|
@ -270,24 +270,24 @@ class LanguageDropdown extends React.PureComponent {
|
||||||
|
|
||||||
this.setState({ open: false });
|
this.setState({ open: false });
|
||||||
onClose(value);
|
onClose(value);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleChange = value => {
|
handleChange = value => {
|
||||||
const { onChange } = this.props;
|
const { onChange } = this.props;
|
||||||
onChange(value);
|
onChange(value);
|
||||||
}
|
};
|
||||||
|
|
||||||
setTargetRef = c => {
|
setTargetRef = c => {
|
||||||
this.target = c;
|
this.target = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
findTarget = () => {
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleOverlayEnter = (state) => {
|
handleOverlayEnter = (state) => {
|
||||||
this.setState({ placement: state.placement });
|
this.setState({ placement: state.placement });
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { value, intl, frequentlyUsedLanguages } = this.props;
|
const { value, intl, frequentlyUsedLanguages } = this.props;
|
||||||
|
|
|
@ -144,7 +144,7 @@ class ComposerOptions extends ImmutablePureComponent {
|
||||||
if (files.length && onUpload) {
|
if (files.length && onUpload) {
|
||||||
onUpload(files);
|
onUpload(files);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Handles attachment clicks.
|
// Handles attachment clicks.
|
||||||
handleClickAttach = (name) => {
|
handleClickAttach = (name) => {
|
||||||
|
@ -164,12 +164,12 @@ class ComposerOptions extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Handles a ref to the file input.
|
// Handles a ref to the file input.
|
||||||
handleRefFileElement = (fileElement) => {
|
handleRefFileElement = (fileElement) => {
|
||||||
this.fileElement = fileElement;
|
this.fileElement = fileElement;
|
||||||
}
|
};
|
||||||
|
|
||||||
renderToggleItemContents = (item) => {
|
renderToggleItemContents = (item) => {
|
||||||
const { onChangeAdvancedOption } = this.props;
|
const { onChangeAdvancedOption } = this.props;
|
||||||
|
|
|
@ -49,15 +49,15 @@ class Option extends React.PureComponent {
|
||||||
|
|
||||||
onSuggestionsClearRequested = () => {
|
onSuggestionsClearRequested = () => {
|
||||||
this.props.onClearSuggestions();
|
this.props.onClearSuggestions();
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionsFetchRequested = (token) => {
|
onSuggestionsFetchRequested = (token) => {
|
||||||
this.props.onFetchSuggestions(token);
|
this.props.onFetchSuggestions(token);
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionSelected = (tokenStart, token, value) => {
|
onSuggestionSelected = (tokenStart, token, value) => {
|
||||||
this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]);
|
this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]);
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { isPollMultiple, title, lang, index, autoFocus, intl } = this.props;
|
const { isPollMultiple, title, lang, index, autoFocus, intl } = this.props;
|
||||||
|
|
|
@ -94,5 +94,6 @@ class Publisher extends ImmutablePureComponent {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ReplyIndicator extends ImmutablePureComponent {
|
||||||
if (onCancel) {
|
if (onCancel) {
|
||||||
onCancel();
|
onCancel();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Rendering.
|
// Rendering.
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -71,14 +71,14 @@ class Search extends React.PureComponent {
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.searchForm = c;
|
this.searchForm = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleChange = (e) => {
|
handleChange = (e) => {
|
||||||
const { onChange } = this.props;
|
const { onChange } = this.props;
|
||||||
if (onChange) {
|
if (onChange) {
|
||||||
onChange(e.target.value);
|
onChange(e.target.value);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClear = (e) => {
|
handleClear = (e) => {
|
||||||
const {
|
const {
|
||||||
|
@ -90,11 +90,11 @@ class Search extends React.PureComponent {
|
||||||
if (onClear && (submitted || value && value.length)) {
|
if (onClear && (submitted || value && value.length)) {
|
||||||
onClear();
|
onClear();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleBlur = () => {
|
handleBlur = () => {
|
||||||
this.setState({ expanded: false });
|
this.setState({ expanded: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFocus = () => {
|
handleFocus = () => {
|
||||||
this.setState({ expanded: true });
|
this.setState({ expanded: true });
|
||||||
|
@ -106,7 +106,7 @@ class Search extends React.PureComponent {
|
||||||
this.searchForm.scrollIntoView();
|
this.searchForm.scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyUp = (e) => {
|
handleKeyUp = (e) => {
|
||||||
const { onSubmit } = this.props;
|
const { onSubmit } = this.props;
|
||||||
|
@ -121,11 +121,11 @@ class Search extends React.PureComponent {
|
||||||
case 'Escape':
|
case 'Escape':
|
||||||
focusRoot();
|
focusRoot();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
findTarget = () => {
|
||||||
return this.searchForm;
|
return this.searchForm;
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, value, submitted } = this.props;
|
const { intl, value, submitted } = this.props;
|
||||||
|
|
|
@ -103,7 +103,7 @@ class SearchResults extends ImmutablePureComponent {
|
||||||
<section className='search-results__section'>
|
<section className='search-results__section'>
|
||||||
<h5><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></h5>
|
<h5><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></h5>
|
||||||
|
|
||||||
{results.get('statuses').map(statusId => <StatusContainer id={statusId} key={statusId}/>)}
|
{results.get('statuses').map(statusId => <StatusContainer id={statusId} key={statusId} />)}
|
||||||
|
|
||||||
{results.get('statuses').size >= 5 && <LoadMore visible onClick={this.handleLoadMoreStatuses} />}
|
{results.get('statuses').size >= 5 && <LoadMore visible onClick={this.handleLoadMoreStatuses} />}
|
||||||
</section>
|
</section>
|
||||||
|
@ -136,5 +136,6 @@ class SearchResults extends ImmutablePureComponent {
|
||||||
{hashtags}
|
{hashtags}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,10 @@ class TextareaIcons extends ImmutablePureComponent {
|
||||||
id={icon}
|
id={icon}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
) : null
|
) : null,
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,12 @@ export default class Upload extends ImmutablePureComponent {
|
||||||
handleUndoClick = e => {
|
handleUndoClick = e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.props.onUndo(this.props.media.get('id'));
|
this.props.onUndo(this.props.media.get('id'));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFocalPointClick = e => {
|
handleFocalPointClick = e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.props.onOpenFocalPoint(this.props.media.get('id'));
|
this.props.onOpenFocalPoint(this.props.media.get('id'));
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { media } = this.props;
|
const { media } = this.props;
|
||||||
|
@ -39,7 +39,7 @@ export default class Upload extends ImmutablePureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='compose-form__upload' tabIndex='0' role='button'>
|
<div className='compose-form__upload' tabIndex='0' role='button'>
|
||||||
<Motion defaultStyle={{ scale: 0.8 }} style={{ scale: spring(1, { stiffness: 180, damping: 12, }) }}>
|
<Motion defaultStyle={{ scale: 0.8 }} style={{ scale: spring(1, { stiffness: 180, damping: 12 }) }}>
|
||||||
{({ scale }) => (
|
{({ scale }) => (
|
||||||
<div className='compose-form__upload-thumbnail' style={{ transform: `scale(${scale})`, backgroundImage: `url(${media.get('preview_url')})`, backgroundPosition: `${x}% ${y}%` }}>
|
<div className='compose-form__upload-thumbnail' style={{ transform: `scale(${scale})`, backgroundImage: `url(${media.get('preview_url')})`, backgroundPosition: `${x}% ${y}%` }}>
|
||||||
<div className='compose-form__upload__actions'>
|
<div className='compose-form__upload__actions'>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue