Fix some more JS linting issues (#2211)

* Minor refactor and linting fixup in `flavours/glitch/actions/accounts.js`

This is some added boilerplate but it's much more consistent with the remaining
of the code, and avoids the linting issue.

* Fix missing /privacy-policy link in DM warning because of wrongly-named import

* Fix unnecessary import

* Fix regexp in flavours/glitch/utils/hashtag.js
This commit is contained in:
Claire
2023-05-08 14:02:41 +02:00
committed by GitHub
parent de74acbe0c
commit 16c5354b8c
5 changed files with 29 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ import {
PINNED_ACCOUNTS_FETCH_REQUEST,
PINNED_ACCOUNTS_FETCH_SUCCESS,
PINNED_ACCOUNTS_FETCH_FAIL,
PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_READY,
PINNED_ACCOUNTS_SUGGESTIONS_FETCH_SUCCESS,
PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CLEAR,
PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CHANGE,
ACCOUNT_PIN_SUCCESS,
@@ -38,10 +38,10 @@ export default function listEditorReducer(state = initialState, action) {
map.set('loaded', true);
map.set('items', ImmutableList(action.accounts.map(item => item.id)));
}));
case PINNED_ACCOUNTS_SUGGESTIONS_FETCH_SUCCESS:
return state.setIn(['suggestions', 'items'], ImmutableList(action.accounts.map(item => item.id)));
case PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CHANGE:
return state.setIn(['suggestions', 'value'], action.value);
case PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_READY:
return state.setIn(['suggestions', 'items'], ImmutableList(action.accounts.map(item => item.id)));
case PINNED_ACCOUNTS_EDITOR_SUGGESTIONS_CLEAR:
return state.update('suggestions', suggestions => suggestions.withMutations(map => {
map.set('items', ImmutableList());