Remove unused variables (#3906)
This commit is contained in:
committed by
Eugen Rochko
parent
6fbb3841a6
commit
eff9416469
@ -20,7 +20,6 @@ import {
|
||||
COMPOSE_SPOILERNESS_CHANGE,
|
||||
COMPOSE_SPOILER_TEXT_CHANGE,
|
||||
COMPOSE_VISIBILITY_CHANGE,
|
||||
COMPOSE_LISTABILITY_CHANGE,
|
||||
COMPOSE_EMOJI_INSERT,
|
||||
} from '../actions/compose';
|
||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
|
||||
import Immutable from 'immutable';
|
||||
|
||||
const initialState = {
|
||||
modalType: null,
|
||||
|
@ -14,60 +14,6 @@ const initialState = Immutable.Map({
|
||||
results: Immutable.Map(),
|
||||
});
|
||||
|
||||
const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
|
||||
let newSuggestions = [];
|
||||
|
||||
if (accounts.length > 0) {
|
||||
newSuggestions.push({
|
||||
title: 'account',
|
||||
items: accounts.map(item => ({
|
||||
type: 'account',
|
||||
id: item.id,
|
||||
value: item.acct,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 || hashtags.length > 0) {
|
||||
let hashtagItems = hashtags.map(item => ({
|
||||
type: 'hashtag',
|
||||
id: item,
|
||||
value: `#${item}`,
|
||||
}));
|
||||
|
||||
if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && !value.startsWith('http://') && !value.startsWith('https://') && hashtags.indexOf(value) === -1) {
|
||||
hashtagItems.unshift({
|
||||
type: 'hashtag',
|
||||
id: value,
|
||||
value: `#${value}`,
|
||||
});
|
||||
}
|
||||
|
||||
if (hashtagItems.length > 0) {
|
||||
newSuggestions.push({
|
||||
title: 'hashtag',
|
||||
items: hashtagItems,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (statuses.length > 0) {
|
||||
newSuggestions.push({
|
||||
title: 'status',
|
||||
items: statuses.map(item => ({
|
||||
type: 'status',
|
||||
id: item.id,
|
||||
value: item.id,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
return state.withMutations(map => {
|
||||
map.set('suggestions', newSuggestions);
|
||||
map.set('loaded_value', value);
|
||||
});
|
||||
};
|
||||
|
||||
export default function search(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case SEARCH_CHANGE:
|
||||
|
@ -11,12 +11,6 @@ import {
|
||||
TIMELINE_CONNECT,
|
||||
TIMELINE_DISCONNECT,
|
||||
} from '../actions/timelines';
|
||||
import {
|
||||
REBLOG_SUCCESS,
|
||||
UNREBLOG_SUCCESS,
|
||||
FAVOURITE_SUCCESS,
|
||||
UNFAVOURITE_SUCCESS,
|
||||
} from '../actions/interactions';
|
||||
import {
|
||||
ACCOUNT_BLOCK_SUCCESS,
|
||||
ACCOUNT_MUTE_SUCCESS,
|
||||
|
Reference in New Issue
Block a user