Compare commits

..

No commits in common. "5d924d0a169851ff654bffd106f43881e6091ec1" and "b808c84b552494bdc983d84f1cb426895acc9415" have entirely different histories.

3 changed files with 12 additions and 31 deletions

View file

@ -116,16 +116,9 @@ const Search = {
this.lastMediaFetchCount = 0
}
let searchTypes = ['statuses', 'media', 'accounts', 'hashtags']
if (searchType) {
searchTypes = [searchType]
} else if (this.preferredTab !== 'statuses') {
searchTypes = [
this.preferredTab,
...searchTypes.filter((tab) => tab !== this.preferredTab)
]
}
const searchTypes = searchType
? [searchType]
: ['statuses', 'media', 'accounts', 'hashtags']
let oldStatusesLength = this.statuses.length
let oldMediaLength = this.media.length
@ -217,7 +210,7 @@ const Search = {
const available = {
statuses: this.visibleStatuses.length > 0,
media: this.visibleMedia.length > 0,
accounts: this.users.length > 0,
people: this.users.length > 0,
hashtags: this.hashtags.length > 0,
}
@ -225,7 +218,7 @@ const Search = {
return this.preferredTab
}
const tabOrder = ['statuses', 'media', 'accounts', 'hashtags']
const tabOrder = ['statuses', 'media', 'people', 'hashtags']
for (const tab of tabOrder) {
if (available[tab]) {
return tab

View file

@ -60,7 +60,7 @@
:label="$t('user_card.media') + resultCount('visibleMedia')"
/>
<span
key="accounts"
key="people"
:label="$t('search.people') + resultCount('users')"
/>
<span
@ -143,7 +143,7 @@
</h4>
</div>
</div>
<div v-else-if="currentResultTab === 'accounts'">
<div v-else-if="currentResultTab === 'people'">
<div
v-if="users.length === 0 && !loading && loadedInitially"
class="search-result-heading"
@ -257,12 +257,6 @@
display: flex;
align-items: center;
& + & {
border-top: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
}
.hashtag {
flex: 1 1 auto;
color: $fallback--text;
@ -270,12 +264,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
box-sizing: border-box;
a {
display: inline-block;
padding: .5em 1em;
}
}
.count {

View file

@ -766,13 +766,13 @@ const statuses = {
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
},
search ({ rootState, dispatch }, { q, resolve, limit, offset, following, type }) {
return rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
search (store, { q, resolve, limit, offset, following, type }) {
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
.then((data) => {
dispatch('addNewUsers', data.accounts)
dispatch('addNewStatuses', { statuses: data.statuses })
store.commit('addNewUsers', data.accounts)
store.commit('addNewStatuses', { statuses: data.statuses })
if ('media' in data) {
dispatch('addNewStatuses', { statuses: data.media })
store.commit('addNewStatuses', { statuses: data.media })
}
return data
})