kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Search: don't infer filter from results, leave it alone
rodzic
511f1de436
commit
e46e217d57
|
@ -28,21 +28,7 @@ const toIds = items => {
|
|||
return ImmutableOrderedSet(items.map(item => item.id));
|
||||
};
|
||||
|
||||
const getResultsFilter = results => {
|
||||
if (results.accounts.length > 0) {
|
||||
return 'accounts';
|
||||
} else if (results.statuses.length > 0) {
|
||||
return 'statuses';
|
||||
} else if (results.hashtags.length > 0) {
|
||||
return 'hashtags';
|
||||
} else {
|
||||
return 'accounts';
|
||||
}
|
||||
};
|
||||
|
||||
const importResults = (state, results) => {
|
||||
const filter = getResultsFilter(results);
|
||||
|
||||
return state.withMutations(state => {
|
||||
state.set('results', ImmutableMap({
|
||||
accounts: toIds(results.accounts),
|
||||
|
@ -57,7 +43,6 @@ const importResults = (state, results) => {
|
|||
}));
|
||||
|
||||
state.set('submitted', true);
|
||||
state.set('filter', filter);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue