[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||
import { Map as ImmutableMap, fromJS } from "immutable";
|
||||
|
||||
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
|
||||
import { normalizeStatusTranslation } from '../actions/importer/normalizer';
|
||||
import { STATUS_IMPORT, STATUSES_IMPORT } from "../actions/importer";
|
||||
import { normalizeStatusTranslation } from "../actions/importer/normalizer";
|
||||
import {
|
||||
REBLOG_REQUEST,
|
||||
REBLOG_FAIL,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
BOOKMARK_FAIL,
|
||||
UNBOOKMARK_REQUEST,
|
||||
UNBOOKMARK_FAIL,
|
||||
} from '../actions/interactions';
|
||||
} from "../actions/interactions";
|
||||
import {
|
||||
STATUS_MUTE_SUCCESS,
|
||||
STATUS_UNMUTE_SUCCESS,
|
||||
@@ -26,8 +26,8 @@ import {
|
||||
STATUS_TRANSLATE_UNDO,
|
||||
STATUS_FETCH_REQUEST,
|
||||
STATUS_FETCH_FAIL,
|
||||
} from '../actions/statuses';
|
||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||
} from "../actions/statuses";
|
||||
import { TIMELINE_DELETE } from "../actions/timelines";
|
||||
|
||||
const importStatus = (state, status) => state.set(status.id, fromJS(status));
|
||||
|
||||
@@ -44,13 +44,13 @@ const deleteStatus = (state, id, references) => {
|
||||
|
||||
const statusTranslateSuccess = (state, id, translation) => {
|
||||
return state.withMutations(map => {
|
||||
map.setIn([id, 'translation'], fromJS(normalizeStatusTranslation(translation, map.get(id))));
|
||||
map.setIn([id, "translation"], fromJS(normalizeStatusTranslation(translation, map.get(id))));
|
||||
|
||||
const list = map.getIn([id, 'media_attachments']);
|
||||
const list = map.getIn([id, "media_attachments"]);
|
||||
if (translation.media_attachments && list) {
|
||||
translation.media_attachments.forEach(item => {
|
||||
const index = list.findIndex(i => i.get('id') === item.id);
|
||||
map.setIn([id, 'media_attachments', index, 'translation'], fromJS({ description: item.description }));
|
||||
const index = list.findIndex(i => i.get("id") === item.id);
|
||||
map.setIn([id, "media_attachments", index, "translation"], fromJS({ description: item.description }));
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -58,8 +58,8 @@ const statusTranslateSuccess = (state, id, translation) => {
|
||||
|
||||
const statusTranslateUndo = (state, id) => {
|
||||
return state.withMutations(map => {
|
||||
map.deleteIn([id, 'translation']);
|
||||
map.getIn([id, 'media_attachments']).forEach((item, index) => map.deleteIn([id, 'media_attachments', index, 'translation']));
|
||||
map.deleteIn([id, "translation"]);
|
||||
map.getIn([id, "media_attachments"]).forEach((item, index) => map.deleteIn([id, "media_attachments", index, "translation"]));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -67,67 +67,67 @@ const initialState = ImmutableMap();
|
||||
|
||||
export default function statuses(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case STATUS_FETCH_REQUEST:
|
||||
return state.setIn([action.id, 'isLoading'], true);
|
||||
case STATUS_FETCH_FAIL:
|
||||
return state.delete(action.id);
|
||||
case STATUS_IMPORT:
|
||||
return importStatus(state, action.status);
|
||||
case STATUSES_IMPORT:
|
||||
return importStatuses(state, action.statuses);
|
||||
case FAVOURITE_REQUEST:
|
||||
return state.setIn([action.status.get('id'), 'favourited'], true);
|
||||
case FAVOURITE_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false);
|
||||
case UNFAVOURITE_REQUEST:
|
||||
return state.setIn([action.status.get('id'), 'favourited'], false);
|
||||
case UNFAVOURITE_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], true);
|
||||
case BOOKMARK_REQUEST:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], true);
|
||||
case BOOKMARK_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], false);
|
||||
case UNBOOKMARK_REQUEST:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], false);
|
||||
case UNBOOKMARK_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'bookmarked'], true);
|
||||
case REBLOG_REQUEST:
|
||||
return state.setIn([action.status.get('id'), 'reblogged'], true);
|
||||
case REBLOG_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'reblogged'], false);
|
||||
case UNREBLOG_REQUEST:
|
||||
return state.setIn([action.status.get('id'), 'reblogged'], false);
|
||||
case UNREBLOG_FAIL:
|
||||
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'reblogged'], true);
|
||||
case STATUS_MUTE_SUCCESS:
|
||||
return state.setIn([action.id, 'muted'], true);
|
||||
case STATUS_UNMUTE_SUCCESS:
|
||||
return state.setIn([action.id, 'muted'], false);
|
||||
case STATUS_REVEAL:
|
||||
return state.withMutations(map => {
|
||||
action.ids.forEach(id => {
|
||||
if (!(state.get(id) === undefined)) {
|
||||
map.setIn([id, 'hidden'], false);
|
||||
}
|
||||
case STATUS_FETCH_REQUEST:
|
||||
return state.setIn([action.id, "isLoading"], true);
|
||||
case STATUS_FETCH_FAIL:
|
||||
return state.delete(action.id);
|
||||
case STATUS_IMPORT:
|
||||
return importStatus(state, action.status);
|
||||
case STATUSES_IMPORT:
|
||||
return importStatuses(state, action.statuses);
|
||||
case FAVOURITE_REQUEST:
|
||||
return state.setIn([action.status.get("id"), "favourited"], true);
|
||||
case FAVOURITE_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "favourited"], false);
|
||||
case UNFAVOURITE_REQUEST:
|
||||
return state.setIn([action.status.get("id"), "favourited"], false);
|
||||
case UNFAVOURITE_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "favourited"], true);
|
||||
case BOOKMARK_REQUEST:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "bookmarked"], true);
|
||||
case BOOKMARK_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "bookmarked"], false);
|
||||
case UNBOOKMARK_REQUEST:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "bookmarked"], false);
|
||||
case UNBOOKMARK_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "bookmarked"], true);
|
||||
case REBLOG_REQUEST:
|
||||
return state.setIn([action.status.get("id"), "reblogged"], true);
|
||||
case REBLOG_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "reblogged"], false);
|
||||
case UNREBLOG_REQUEST:
|
||||
return state.setIn([action.status.get("id"), "reblogged"], false);
|
||||
case UNREBLOG_FAIL:
|
||||
return state.get(action.status.get("id")) === undefined ? state : state.setIn([action.status.get("id"), "reblogged"], true);
|
||||
case STATUS_MUTE_SUCCESS:
|
||||
return state.setIn([action.id, "muted"], true);
|
||||
case STATUS_UNMUTE_SUCCESS:
|
||||
return state.setIn([action.id, "muted"], false);
|
||||
case STATUS_REVEAL:
|
||||
return state.withMutations(map => {
|
||||
action.ids.forEach(id => {
|
||||
if (!(state.get(id) === undefined)) {
|
||||
map.setIn([id, "hidden"], false);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
case STATUS_HIDE:
|
||||
return state.withMutations(map => {
|
||||
action.ids.forEach(id => {
|
||||
if (!(state.get(id) === undefined)) {
|
||||
map.setIn([id, 'hidden'], true);
|
||||
}
|
||||
case STATUS_HIDE:
|
||||
return state.withMutations(map => {
|
||||
action.ids.forEach(id => {
|
||||
if (!(state.get(id) === undefined)) {
|
||||
map.setIn([id, "hidden"], true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
case STATUS_COLLAPSE:
|
||||
return state.setIn([action.id, 'collapsed'], action.isCollapsed);
|
||||
case TIMELINE_DELETE:
|
||||
return deleteStatus(state, action.id, action.references);
|
||||
case STATUS_TRANSLATE_SUCCESS:
|
||||
return statusTranslateSuccess(state, action.id, action.translation);
|
||||
case STATUS_TRANSLATE_UNDO:
|
||||
return statusTranslateUndo(state, action.id);
|
||||
default:
|
||||
return state;
|
||||
case STATUS_COLLAPSE:
|
||||
return state.setIn([action.id, "collapsed"], action.isCollapsed);
|
||||
case TIMELINE_DELETE:
|
||||
return deleteStatus(state, action.id, action.references);
|
||||
case STATUS_TRANSLATE_SUCCESS:
|
||||
return statusTranslateSuccess(state, action.id, action.translation);
|
||||
case STATUS_TRANSLATE_UNDO:
|
||||
return statusTranslateUndo(state, action.id);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user