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:
@@ -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());
|
||||
|
Reference in New Issue
Block a user