diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js
index d4a824e2c..ad77dfb6f 100644
--- a/app/javascript/mastodon/actions/accounts.js
+++ b/app/javascript/mastodon/actions/accounts.js
@@ -4,75 +4,75 @@ import { importAccount, importFetchedAccount, importFetchedAccounts } from './im
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
export const ACCOUNT_FETCH_SUCCESS = 'ACCOUNT_FETCH_SUCCESS';
-export const ACCOUNT_FETCH_FAIL = 'ACCOUNT_FETCH_FAIL';
+export const ACCOUNT_FETCH_FAIL = 'ACCOUNT_FETCH_FAIL';
export const ACCOUNT_FOLLOW_REQUEST = 'ACCOUNT_FOLLOW_REQUEST';
export const ACCOUNT_FOLLOW_SUCCESS = 'ACCOUNT_FOLLOW_SUCCESS';
-export const ACCOUNT_FOLLOW_FAIL = 'ACCOUNT_FOLLOW_FAIL';
+export const ACCOUNT_FOLLOW_FAIL = 'ACCOUNT_FOLLOW_FAIL';
export const ACCOUNT_UNFOLLOW_REQUEST = 'ACCOUNT_UNFOLLOW_REQUEST';
export const ACCOUNT_UNFOLLOW_SUCCESS = 'ACCOUNT_UNFOLLOW_SUCCESS';
-export const ACCOUNT_UNFOLLOW_FAIL = 'ACCOUNT_UNFOLLOW_FAIL';
+export const ACCOUNT_UNFOLLOW_FAIL = 'ACCOUNT_UNFOLLOW_FAIL';
export const ACCOUNT_BLOCK_REQUEST = 'ACCOUNT_BLOCK_REQUEST';
export const ACCOUNT_BLOCK_SUCCESS = 'ACCOUNT_BLOCK_SUCCESS';
-export const ACCOUNT_BLOCK_FAIL = 'ACCOUNT_BLOCK_FAIL';
+export const ACCOUNT_BLOCK_FAIL = 'ACCOUNT_BLOCK_FAIL';
export const ACCOUNT_UNBLOCK_REQUEST = 'ACCOUNT_UNBLOCK_REQUEST';
export const ACCOUNT_UNBLOCK_SUCCESS = 'ACCOUNT_UNBLOCK_SUCCESS';
-export const ACCOUNT_UNBLOCK_FAIL = 'ACCOUNT_UNBLOCK_FAIL';
+export const ACCOUNT_UNBLOCK_FAIL = 'ACCOUNT_UNBLOCK_FAIL';
export const ACCOUNT_MUTE_REQUEST = 'ACCOUNT_MUTE_REQUEST';
export const ACCOUNT_MUTE_SUCCESS = 'ACCOUNT_MUTE_SUCCESS';
-export const ACCOUNT_MUTE_FAIL = 'ACCOUNT_MUTE_FAIL';
+export const ACCOUNT_MUTE_FAIL = 'ACCOUNT_MUTE_FAIL';
export const ACCOUNT_UNMUTE_REQUEST = 'ACCOUNT_UNMUTE_REQUEST';
export const ACCOUNT_UNMUTE_SUCCESS = 'ACCOUNT_UNMUTE_SUCCESS';
-export const ACCOUNT_UNMUTE_FAIL = 'ACCOUNT_UNMUTE_FAIL';
+export const ACCOUNT_UNMUTE_FAIL = 'ACCOUNT_UNMUTE_FAIL';
export const ACCOUNT_PIN_REQUEST = 'ACCOUNT_PIN_REQUEST';
export const ACCOUNT_PIN_SUCCESS = 'ACCOUNT_PIN_SUCCESS';
-export const ACCOUNT_PIN_FAIL = 'ACCOUNT_PIN_FAIL';
+export const ACCOUNT_PIN_FAIL = 'ACCOUNT_PIN_FAIL';
export const ACCOUNT_UNPIN_REQUEST = 'ACCOUNT_UNPIN_REQUEST';
export const ACCOUNT_UNPIN_SUCCESS = 'ACCOUNT_UNPIN_SUCCESS';
-export const ACCOUNT_UNPIN_FAIL = 'ACCOUNT_UNPIN_FAIL';
+export const ACCOUNT_UNPIN_FAIL = 'ACCOUNT_UNPIN_FAIL';
export const FOLLOWERS_FETCH_REQUEST = 'FOLLOWERS_FETCH_REQUEST';
export const FOLLOWERS_FETCH_SUCCESS = 'FOLLOWERS_FETCH_SUCCESS';
-export const FOLLOWERS_FETCH_FAIL = 'FOLLOWERS_FETCH_FAIL';
+export const FOLLOWERS_FETCH_FAIL = 'FOLLOWERS_FETCH_FAIL';
export const FOLLOWERS_EXPAND_REQUEST = 'FOLLOWERS_EXPAND_REQUEST';
export const FOLLOWERS_EXPAND_SUCCESS = 'FOLLOWERS_EXPAND_SUCCESS';
-export const FOLLOWERS_EXPAND_FAIL = 'FOLLOWERS_EXPAND_FAIL';
+export const FOLLOWERS_EXPAND_FAIL = 'FOLLOWERS_EXPAND_FAIL';
export const FOLLOWING_FETCH_REQUEST = 'FOLLOWING_FETCH_REQUEST';
export const FOLLOWING_FETCH_SUCCESS = 'FOLLOWING_FETCH_SUCCESS';
-export const FOLLOWING_FETCH_FAIL = 'FOLLOWING_FETCH_FAIL';
+export const FOLLOWING_FETCH_FAIL = 'FOLLOWING_FETCH_FAIL';
export const FOLLOWING_EXPAND_REQUEST = 'FOLLOWING_EXPAND_REQUEST';
export const FOLLOWING_EXPAND_SUCCESS = 'FOLLOWING_EXPAND_SUCCESS';
-export const FOLLOWING_EXPAND_FAIL = 'FOLLOWING_EXPAND_FAIL';
+export const FOLLOWING_EXPAND_FAIL = 'FOLLOWING_EXPAND_FAIL';
export const RELATIONSHIPS_FETCH_REQUEST = 'RELATIONSHIPS_FETCH_REQUEST';
export const RELATIONSHIPS_FETCH_SUCCESS = 'RELATIONSHIPS_FETCH_SUCCESS';
-export const RELATIONSHIPS_FETCH_FAIL = 'RELATIONSHIPS_FETCH_FAIL';
+export const RELATIONSHIPS_FETCH_FAIL = 'RELATIONSHIPS_FETCH_FAIL';
export const FOLLOW_REQUESTS_FETCH_REQUEST = 'FOLLOW_REQUESTS_FETCH_REQUEST';
export const FOLLOW_REQUESTS_FETCH_SUCCESS = 'FOLLOW_REQUESTS_FETCH_SUCCESS';
-export const FOLLOW_REQUESTS_FETCH_FAIL = 'FOLLOW_REQUESTS_FETCH_FAIL';
+export const FOLLOW_REQUESTS_FETCH_FAIL = 'FOLLOW_REQUESTS_FETCH_FAIL';
export const FOLLOW_REQUESTS_EXPAND_REQUEST = 'FOLLOW_REQUESTS_EXPAND_REQUEST';
export const FOLLOW_REQUESTS_EXPAND_SUCCESS = 'FOLLOW_REQUESTS_EXPAND_SUCCESS';
-export const FOLLOW_REQUESTS_EXPAND_FAIL = 'FOLLOW_REQUESTS_EXPAND_FAIL';
+export const FOLLOW_REQUESTS_EXPAND_FAIL = 'FOLLOW_REQUESTS_EXPAND_FAIL';
export const FOLLOW_REQUEST_AUTHORIZE_REQUEST = 'FOLLOW_REQUEST_AUTHORIZE_REQUEST';
export const FOLLOW_REQUEST_AUTHORIZE_SUCCESS = 'FOLLOW_REQUEST_AUTHORIZE_SUCCESS';
-export const FOLLOW_REQUEST_AUTHORIZE_FAIL = 'FOLLOW_REQUEST_AUTHORIZE_FAIL';
+export const FOLLOW_REQUEST_AUTHORIZE_FAIL = 'FOLLOW_REQUEST_AUTHORIZE_FAIL';
export const FOLLOW_REQUEST_REJECT_REQUEST = 'FOLLOW_REQUEST_REJECT_REQUEST';
export const FOLLOW_REQUEST_REJECT_SUCCESS = 'FOLLOW_REQUEST_REJECT_SUCCESS';
-export const FOLLOW_REQUEST_REJECT_FAIL = 'FOLLOW_REQUEST_REJECT_FAIL';
+export const FOLLOW_REQUEST_REJECT_FAIL = 'FOLLOW_REQUEST_REJECT_FAIL';
function getFromDB(dispatch, getState, index, id) {
return new Promise((resolve, reject) => {
@@ -106,7 +106,7 @@ export function fetchAccount(id) {
dispatch,
getState,
db.transaction('accounts', 'read').objectStore('accounts').index('id'),
- id
+ id,
).then(() => db.close(), error => {
db.close();
throw error;
@@ -135,7 +135,7 @@ export function fetchAccountSuccess() {
export function fetchAccountFail(id, error) {
return {
- type: ACCOUNT_FETCH_FAIL,
+ type : ACCOUNT_FETCH_FAIL,
id,
error,
skipAlert: true,
@@ -171,7 +171,7 @@ export function unfollowAccount(id) {
export function followAccountRequest(id, locked) {
return {
- type: ACCOUNT_FOLLOW_REQUEST,
+ type : ACCOUNT_FOLLOW_REQUEST,
id,
locked,
skipLoading: true,
@@ -180,7 +180,7 @@ export function followAccountRequest(id, locked) {
export function followAccountSuccess(relationship, alreadyFollowing) {
return {
- type: ACCOUNT_FOLLOW_SUCCESS,
+ type : ACCOUNT_FOLLOW_SUCCESS,
relationship,
alreadyFollowing,
skipLoading: true,
@@ -189,7 +189,7 @@ export function followAccountSuccess(relationship, alreadyFollowing) {
export function followAccountFail(error, locked) {
return {
- type: ACCOUNT_FOLLOW_FAIL,
+ type : ACCOUNT_FOLLOW_FAIL,
error,
locked,
skipLoading: true,
@@ -198,7 +198,7 @@ export function followAccountFail(error, locked) {
export function unfollowAccountRequest(id) {
return {
- type: ACCOUNT_UNFOLLOW_REQUEST,
+ type : ACCOUNT_UNFOLLOW_REQUEST,
id,
skipLoading: true,
};
@@ -206,7 +206,7 @@ export function unfollowAccountRequest(id) {
export function unfollowAccountSuccess(relationship, statuses) {
return {
- type: ACCOUNT_UNFOLLOW_SUCCESS,
+ type : ACCOUNT_UNFOLLOW_SUCCESS,
relationship,
statuses,
skipLoading: true,
@@ -215,7 +215,7 @@ export function unfollowAccountSuccess(relationship, statuses) {
export function unfollowAccountFail(error) {
return {
- type: ACCOUNT_UNFOLLOW_FAIL,
+ type : ACCOUNT_UNFOLLOW_FAIL,
error,
skipLoading: true,
};
@@ -289,7 +289,6 @@ export function unblockAccountFail(error) {
};
};
-
export function muteAccount(id, notifications) {
return (dispatch, getState) => {
dispatch(muteAccountRequest(id));
@@ -358,7 +357,6 @@ export function unmuteAccountFail(error) {
};
};
-
export function fetchFollowers(id) {
return (dispatch, getState) => {
dispatch(fetchFollowersRequest(id));
@@ -469,6 +467,7 @@ export function fetchFollowingRequest(id) {
};
export function fetchFollowingSuccess(id, accounts, next) {
+ console.log('id,accounts,next', id, accounts, next);
return {
type: FOLLOWING_FETCH_SUCCESS,
id,
@@ -552,7 +551,7 @@ export function fetchRelationships(accountIds) {
export function fetchRelationshipsRequest(ids) {
return {
- type: RELATIONSHIPS_FETCH_REQUEST,
+ type : RELATIONSHIPS_FETCH_REQUEST,
ids,
skipLoading: true,
};
@@ -560,7 +559,7 @@ export function fetchRelationshipsRequest(ids) {
export function fetchRelationshipsSuccess(relationships) {
return {
- type: RELATIONSHIPS_FETCH_SUCCESS,
+ type : RELATIONSHIPS_FETCH_SUCCESS,
relationships,
skipLoading: true,
};
@@ -568,7 +567,7 @@ export function fetchRelationshipsSuccess(relationships) {
export function fetchRelationshipsFail(error) {
return {
- type: RELATIONSHIPS_FETCH_FAIL,
+ type : RELATIONSHIPS_FETCH_FAIL,
error,
skipLoading: true,
};
@@ -679,7 +678,6 @@ export function authorizeFollowRequestFail(id, error) {
};
};
-
export function rejectFollowRequest(id) {
return (dispatch, getState) => {
dispatch(rejectFollowRequestRequest(id));
diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js
index c3c6ff1a1..f4d987294 100644
--- a/app/javascript/mastodon/actions/compose.js
+++ b/app/javascript/mastodon/actions/compose.js
@@ -7,26 +7,25 @@ import { useEmoji } from './emojis';
import resizeImage from '../utils/resize_image';
import { importFetchedAccounts } from './importer';
import { updateTimeline } from './timelines';
-import { showAlertForError } from './alerts';
-import { showAlert } from './alerts';
+import { showAlert, showAlertForError } from './alerts';
import { defineMessages } from 'react-intl';
let cancelFetchComposeSuggestionsAccounts, cancelFetchComposeSuggestionsTags;
-export const COMPOSE_CHANGE = 'COMPOSE_CHANGE';
-export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST';
-export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS';
-export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL';
-export const COMPOSE_REPLY = 'COMPOSE_REPLY';
-export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL';
-export const COMPOSE_DIRECT = 'COMPOSE_DIRECT';
-export const COMPOSE_MENTION = 'COMPOSE_MENTION';
-export const COMPOSE_RESET = 'COMPOSE_RESET';
-export const COMPOSE_UPLOAD_REQUEST = 'COMPOSE_UPLOAD_REQUEST';
-export const COMPOSE_UPLOAD_SUCCESS = 'COMPOSE_UPLOAD_SUCCESS';
-export const COMPOSE_UPLOAD_FAIL = 'COMPOSE_UPLOAD_FAIL';
+export const COMPOSE_CHANGE = 'COMPOSE_CHANGE';
+export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST';
+export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS';
+export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL';
+export const COMPOSE_REPLY = 'COMPOSE_REPLY';
+export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL';
+export const COMPOSE_DIRECT = 'COMPOSE_DIRECT';
+export const COMPOSE_MENTION = 'COMPOSE_MENTION';
+export const COMPOSE_RESET = 'COMPOSE_RESET';
+export const COMPOSE_UPLOAD_REQUEST = 'COMPOSE_UPLOAD_REQUEST';
+export const COMPOSE_UPLOAD_SUCCESS = 'COMPOSE_UPLOAD_SUCCESS';
+export const COMPOSE_UPLOAD_FAIL = 'COMPOSE_UPLOAD_FAIL';
export const COMPOSE_UPLOAD_PROGRESS = 'COMPOSE_UPLOAD_PROGRESS';
-export const COMPOSE_UPLOAD_UNDO = 'COMPOSE_UPLOAD_UNDO';
+export const COMPOSE_UPLOAD_UNDO = 'COMPOSE_UPLOAD_UNDO';
export const COMPOSE_SUGGESTIONS_CLEAR = 'COMPOSE_SUGGESTIONS_CLEAR';
export const COMPOSE_SUGGESTIONS_READY = 'COMPOSE_SUGGESTIONS_READY';
@@ -35,32 +34,32 @@ export const COMPOSE_SUGGESTION_TAGS_UPDATE = 'COMPOSE_SUGGESTION_TAGS_UPDATE';
export const COMPOSE_TAG_HISTORY_UPDATE = 'COMPOSE_TAG_HISTORY_UPDATE';
-export const COMPOSE_MOUNT = 'COMPOSE_MOUNT';
+export const COMPOSE_MOUNT = 'COMPOSE_MOUNT';
export const COMPOSE_UNMOUNT = 'COMPOSE_UNMOUNT';
export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE';
export const COMPOSE_SPOILERNESS_CHANGE = 'COMPOSE_SPOILERNESS_CHANGE';
export const COMPOSE_SPOILER_TEXT_CHANGE = 'COMPOSE_SPOILER_TEXT_CHANGE';
-export const COMPOSE_VISIBILITY_CHANGE = 'COMPOSE_VISIBILITY_CHANGE';
+export const COMPOSE_VISIBILITY_CHANGE = 'COMPOSE_VISIBILITY_CHANGE';
export const COMPOSE_LISTABILITY_CHANGE = 'COMPOSE_LISTABILITY_CHANGE';
export const COMPOSE_COMPOSING_CHANGE = 'COMPOSE_COMPOSING_CHANGE';
export const COMPOSE_EMOJI_INSERT = 'COMPOSE_EMOJI_INSERT';
-export const COMPOSE_UPLOAD_CHANGE_REQUEST = 'COMPOSE_UPLOAD_UPDATE_REQUEST';
-export const COMPOSE_UPLOAD_CHANGE_SUCCESS = 'COMPOSE_UPLOAD_UPDATE_SUCCESS';
-export const COMPOSE_UPLOAD_CHANGE_FAIL = 'COMPOSE_UPLOAD_UPDATE_FAIL';
+export const COMPOSE_UPLOAD_CHANGE_REQUEST = 'COMPOSE_UPLOAD_UPDATE_REQUEST';
+export const COMPOSE_UPLOAD_CHANGE_SUCCESS = 'COMPOSE_UPLOAD_UPDATE_SUCCESS';
+export const COMPOSE_UPLOAD_CHANGE_FAIL = 'COMPOSE_UPLOAD_UPDATE_FAIL';
-export const COMPOSE_POLL_ADD = 'COMPOSE_POLL_ADD';
-export const COMPOSE_POLL_REMOVE = 'COMPOSE_POLL_REMOVE';
-export const COMPOSE_POLL_OPTION_ADD = 'COMPOSE_POLL_OPTION_ADD';
-export const COMPOSE_POLL_OPTION_CHANGE = 'COMPOSE_POLL_OPTION_CHANGE';
-export const COMPOSE_POLL_OPTION_REMOVE = 'COMPOSE_POLL_OPTION_REMOVE';
+export const COMPOSE_POLL_ADD = 'COMPOSE_POLL_ADD';
+export const COMPOSE_POLL_REMOVE = 'COMPOSE_POLL_REMOVE';
+export const COMPOSE_POLL_OPTION_ADD = 'COMPOSE_POLL_OPTION_ADD';
+export const COMPOSE_POLL_OPTION_CHANGE = 'COMPOSE_POLL_OPTION_CHANGE';
+export const COMPOSE_POLL_OPTION_REMOVE = 'COMPOSE_POLL_OPTION_REMOVE';
export const COMPOSE_POLL_SETTINGS_CHANGE = 'COMPOSE_POLL_SETTINGS_CHANGE';
const messages = defineMessages({
uploadErrorLimit: { id: 'upload_error.limit', defaultMessage: 'File upload limit exceeded.' },
- uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' },
+ uploadErrorPoll : { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' },
});
const COMPOSE_PANEL_BREAKPOINT = 600 + (285 * 1) + (10 * 1);
@@ -81,7 +80,7 @@ export function changeCompose(text) {
export function replyCompose(status, routerHistory) {
return (dispatch, getState) => {
dispatch({
- type: COMPOSE_REPLY,
+ type : COMPOSE_REPLY,
status: status,
});
@@ -104,7 +103,7 @@ export function resetCompose() {
export function mentionCompose(account, routerHistory) {
return (dispatch, getState) => {
dispatch({
- type: COMPOSE_MENTION,
+ type : COMPOSE_MENTION,
account: account,
});
@@ -115,7 +114,7 @@ export function mentionCompose(account, routerHistory) {
export function directCompose(account, routerHistory) {
return (dispatch, getState) => {
dispatch({
- type: COMPOSE_DIRECT,
+ type : COMPOSE_DIRECT,
account: account,
});
@@ -126,7 +125,7 @@ export function directCompose(account, routerHistory) {
export function submitCompose(routerHistory) {
return function (dispatch, getState) {
const status = getState().getIn(['compose', 'text'], '');
- const media = getState().getIn(['compose', 'media_attachments']);
+ const media = getState().getIn(['compose', 'media_attachments']);
if ((!status || !status.length) && media.size === 0) {
return;
@@ -137,11 +136,11 @@ export function submitCompose(routerHistory) {
api(getState).post('/api/v1/statuses', {
status,
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
- media_ids: media.map(item => item.get('id')),
- sensitive: getState().getIn(['compose', 'sensitive']),
- spoiler_text: getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '',
- visibility: getState().getIn(['compose', 'privacy']),
- poll: getState().getIn(['compose', 'poll'], null),
+ media_ids : media.map(item => item.get('id')),
+ sensitive : getState().getIn(['compose', 'sensitive']),
+ spoiler_text : getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '',
+ visibility : getState().getIn(['compose', 'privacy']),
+ poll : getState().getIn(['compose', 'poll'], null),
}, {
headers: {
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
@@ -189,14 +188,14 @@ export function submitComposeRequest() {
export function submitComposeSuccess(status) {
return {
- type: COMPOSE_SUBMIT_SUCCESS,
+ type : COMPOSE_SUBMIT_SUCCESS,
status: status,
};
};
export function submitComposeFail(error) {
return {
- type: COMPOSE_SUBMIT_FAIL,
+ type : COMPOSE_SUBMIT_FAIL,
error: error,
};
};
@@ -204,8 +203,8 @@ export function submitComposeFail(error) {
export function uploadCompose(files) {
return function (dispatch, getState) {
const uploadLimit = 4;
- const media = getState().getIn(['compose', 'media_attachments']);
- const pending = getState().getIn(['compose', 'pending_media_attachments']);
+ const media = getState().getIn(['compose', 'media_attachments']);
+ const pending = getState().getIn(['compose', 'pending_media_attachments']);
const progress = new Array(files.length).fill(0);
let total = Array.from(files).reduce((a, v) => a + v.size, 0);
@@ -231,13 +230,14 @@ export function uploadCompose(files) {
total += file.size - f.size;
return api(getState).post('/api/v1/media', data, {
- onUploadProgress: function({ loaded }){
+ onUploadProgress: function ({ loaded }) {
progress[i] = loaded;
dispatch(uploadComposeProgress(progress.reduce((a, v) => a + v, 0), total));
},
}).then(({ data }) => dispatch(uploadComposeSuccess(data, f)));
}).catch(error => dispatch(uploadComposeFail(error)));
- };
+ }
+ ;
};
};
@@ -255,61 +255,62 @@ export function changeUploadCompose(id, params) {
export function changeUploadComposeRequest() {
return {
- type: COMPOSE_UPLOAD_CHANGE_REQUEST,
+ type : COMPOSE_UPLOAD_CHANGE_REQUEST,
skipLoading: true,
};
};
+
export function changeUploadComposeSuccess(media) {
return {
- type: COMPOSE_UPLOAD_CHANGE_SUCCESS,
- media: media,
+ type : COMPOSE_UPLOAD_CHANGE_SUCCESS,
+ media : media,
skipLoading: true,
};
};
export function changeUploadComposeFail(error) {
return {
- type: COMPOSE_UPLOAD_CHANGE_FAIL,
- error: error,
+ type : COMPOSE_UPLOAD_CHANGE_FAIL,
+ error : error,
skipLoading: true,
};
};
export function uploadComposeRequest() {
return {
- type: COMPOSE_UPLOAD_REQUEST,
+ type : COMPOSE_UPLOAD_REQUEST,
skipLoading: true,
};
};
export function uploadComposeProgress(loaded, total) {
return {
- type: COMPOSE_UPLOAD_PROGRESS,
+ type : COMPOSE_UPLOAD_PROGRESS,
loaded: loaded,
- total: total,
+ total : total,
};
};
export function uploadComposeSuccess(media, file) {
return {
- type: COMPOSE_UPLOAD_SUCCESS,
- media: media,
- file: file,
+ type : COMPOSE_UPLOAD_SUCCESS,
+ media : media,
+ file : file,
skipLoading: true,
};
};
export function uploadComposeFail(error) {
return {
- type: COMPOSE_UPLOAD_FAIL,
- error: error,
+ type : COMPOSE_UPLOAD_FAIL,
+ error : error,
skipLoading: true,
};
};
export function undoUploadCompose(media_id) {
return {
- type: COMPOSE_UPLOAD_UNDO,
+ type : COMPOSE_UPLOAD_UNDO,
media_id: media_id,
};
};
@@ -334,9 +335,9 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) =>
}),
params: {
- q: token.slice(1),
+ q : token.slice(1),
resolve: false,
- limit: 4,
+ limit : 4,
},
}).then(response => {
dispatch(importFetchedAccounts(response.data));
@@ -366,10 +367,10 @@ const fetchComposeSuggestionsTags = throttle((dispatch, getState, token) => {
}),
params: {
- type: 'hashtags',
- q: token.slice(1),
- resolve: false,
- limit: 4,
+ type : 'hashtags',
+ q : token.slice(1),
+ resolve : false,
+ limit : 4,
exclude_unreviewed: true,
},
}).then(({ data }) => {
@@ -424,20 +425,20 @@ export function selectComposeSuggestion(position, token, suggestion, path) {
let completion, startPosition;
if (suggestion.type === 'emoji') {
- completion = suggestion.native || suggestion.colons;
+ completion = suggestion.native || suggestion.colons;
startPosition = position - 1;
dispatch(useEmoji(suggestion));
} else if (suggestion.type === 'hashtag') {
- completion = `#${suggestion.name}`;
+ completion = `#${suggestion.name}`;
startPosition = position - 1;
} else if (suggestion.type === 'account') {
- completion = getState().getIn(['accounts', suggestion.id, 'acct']);
+ completion = getState().getIn(['accounts', suggestion.id, 'acct']);
startPosition = position;
}
dispatch({
- type: COMPOSE_SUGGESTION_SELECT,
+ type : COMPOSE_SUGGESTION_SELECT,
position: startPosition,
token,
completion,
@@ -463,6 +464,7 @@ export function updateTagHistory(tags) {
export function hydrateCompose() {
return (dispatch, getState) => {
const me = getState().getIn(['meta', 'me']);
+ console.log('my user id:', me);
const history = tagHistory.get(me);
if (history !== null) {
diff --git a/app/javascript/mastodon/features/compose/containers/compose_form_container.js b/app/javascript/mastodon/features/compose/containers/compose_form_container.js
index 37a0e8845..4f4d5f5d4 100644
--- a/app/javascript/mastodon/features/compose/containers/compose_form_container.js
+++ b/app/javascript/mastodon/features/compose/containers/compose_form_container.js
@@ -2,62 +2,62 @@ import { connect } from 'react-redux';
import ComposeForm from '../components/compose_form';
import {
changeCompose,
- submitCompose,
+ changeComposeSpoilerText,
clearComposeSuggestions,
fetchComposeSuggestions,
- selectComposeSuggestion,
- changeComposeSpoilerText,
insertEmojiCompose,
+ selectComposeSuggestion,
+ submitCompose,
uploadCompose,
} from '../../../actions/compose';
const mapStateToProps = state => ({
- text: state.getIn(['compose', 'text']),
- suggestions: state.getIn(['compose', 'suggestions']),
- spoiler: state.getIn(['compose', 'spoiler']),
- spoilerText: state.getIn(['compose', 'spoiler_text']),
- privacy: state.getIn(['compose', 'privacy']),
- focusDate: state.getIn(['compose', 'focusDate']),
- caretPosition: state.getIn(['compose', 'caretPosition']),
- preselectDate: state.getIn(['compose', 'preselectDate']),
- isSubmitting: state.getIn(['compose', 'is_submitting']),
+ text : state.getIn(['compose', 'text']),
+ suggestions : state.getIn(['compose', 'suggestions']),
+ spoiler : state.getIn(['compose', 'spoiler']),
+ spoilerText : state.getIn(['compose', 'spoiler_text']),
+ privacy : state.getIn(['compose', 'privacy']),
+ focusDate : state.getIn(['compose', 'focusDate']),
+ caretPosition : state.getIn(['compose', 'caretPosition']),
+ preselectDate : state.getIn(['compose', 'preselectDate']),
+ isSubmitting : state.getIn(['compose', 'is_submitting']),
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
- isUploading: state.getIn(['compose', 'is_uploading']),
- showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
- anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
+ isUploading : state.getIn(['compose', 'is_uploading']),
+ showSearch : state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
+ anyMedia : state.getIn(['compose', 'media_attachments']).size > 0,
});
const mapDispatchToProps = (dispatch) => ({
- onChange (text) {
+ onChange(text) {
dispatch(changeCompose(text));
},
- onSubmit (router) {
+ onSubmit(router) {
dispatch(submitCompose(router));
},
- onClearSuggestions () {
+ onClearSuggestions() {
dispatch(clearComposeSuggestions());
},
- onFetchSuggestions (token) {
+ onFetchSuggestions(token) {
dispatch(fetchComposeSuggestions(token));
},
- onSuggestionSelected (position, token, suggestion, path) {
+ onSuggestionSelected(position, token, suggestion, path) {
dispatch(selectComposeSuggestion(position, token, suggestion, path));
},
- onChangeSpoilerText (checked) {
+ onChangeSpoilerText(checked) {
dispatch(changeComposeSpoilerText(checked));
},
- onPaste (files) {
+ onPaste(files) {
dispatch(uploadCompose(files));
},
- onPickEmoji (position, data, needsSpace) {
+ onPickEmoji(position, data, needsSpace) {
dispatch(insertEmojiCompose(position, data, needsSpace));
},
diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js
index 284ae2c11..fc13aa7d3 100644
--- a/app/javascript/mastodon/features/following/index.js
+++ b/app/javascript/mastodon/features/following/index.js
@@ -5,11 +5,7 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { debounce } from 'lodash';
import LoadingIndicator from '../../components/loading_indicator';
-import {
- fetchAccount,
- fetchFollowing,
- expandFollowing,
-} from '../../actions/accounts';
+import { expandFollowing, fetchAccount, fetchFollowing } from '../../actions/accounts';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../containers/account_container';
import Column from '../ui/components/column';
@@ -19,34 +15,34 @@ import ScrollableList from '../../components/scrollable_list';
import MissingIndicator from 'mastodon/components/missing_indicator';
const mapStateToProps = (state, props) => ({
- isAccount: !!state.getIn(['accounts', props.params.accountId]),
+ isAccount : !!state.getIn(['accounts', props.params.accountId]),
accountIds: state.getIn(['user_lists', 'following', props.params.accountId, 'items']),
- hasMore: !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']),
- blockedBy: state.getIn(['relationships', props.params.accountId, 'blocked_by'], false),
+ hasMore : !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']),
+ blockedBy : state.getIn(['relationships', props.params.accountId, 'blocked_by'], false),
});
export default @connect(mapStateToProps)
class Following extends ImmutablePureComponent {
static propTypes = {
- params: PropTypes.object.isRequired,
- dispatch: PropTypes.func.isRequired,
+ params : PropTypes.object.isRequired,
+ dispatch : PropTypes.func.isRequired,
shouldUpdateScroll: PropTypes.func,
- accountIds: ImmutablePropTypes.list,
- hasMore: PropTypes.bool,
- blockedBy: PropTypes.bool,
- isAccount: PropTypes.bool,
- multiColumn: PropTypes.bool,
+ accountIds : ImmutablePropTypes.list,
+ hasMore : PropTypes.bool,
+ blockedBy : PropTypes.bool,
+ isAccount : PropTypes.bool,
+ multiColumn : PropTypes.bool,
};
- componentWillMount () {
+ componentWillMount() {
if (!this.props.accountIds) {
this.props.dispatch(fetchAccount(this.props.params.accountId));
this.props.dispatch(fetchFollowing(this.props.params.accountId));
}
}
- componentWillReceiveProps (nextProps) {
+ componentWillReceiveProps(nextProps) {
if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {
this.props.dispatch(fetchAccount(nextProps.params.accountId));
this.props.dispatch(fetchFollowing(nextProps.params.accountId));
@@ -57,29 +53,35 @@ class Following extends ImmutablePureComponent {
this.props.dispatch(expandFollowing(this.props.params.accountId));
}, 300, { leading: true });
- render () {
+ render() {
const { shouldUpdateScroll, accountIds, hasMore, blockedBy, isAccount, multiColumn } = this.props;
if (!isAccount) {
return (
-