Compare commits
2 Commits
139d43eda5
...
a4915a6501
Author | SHA1 | Date |
---|---|---|
itepechi | a4915a6501 | |
itepechi | 7042d0f4b6 |
|
@ -155,6 +155,7 @@
|
|||
>
|
||||
<StillImage
|
||||
class="image"
|
||||
:loading="'lazy'"
|
||||
:referrerpolicy="referrerpolicy"
|
||||
:mimetype="attachment.mimetype"
|
||||
:src="attachment.large_thumb_url || attachment.url"
|
||||
|
|
|
@ -36,6 +36,7 @@ const Search = {
|
|||
media: [],
|
||||
hashtags: [],
|
||||
currenResultTab: 'statuses',
|
||||
preferredTab : 'statuses',
|
||||
|
||||
statusesOffset: 0,
|
||||
lastStatusFetchCount: 0,
|
||||
|
@ -162,17 +163,26 @@ const Search = {
|
|||
},
|
||||
onResultTabSwitch (key) {
|
||||
this.currenResultTab = key
|
||||
this.preferredTab = key
|
||||
this.loading = false
|
||||
},
|
||||
getActiveTab () {
|
||||
if (this.visibleStatuses.length > 0) {
|
||||
return 'statuses'
|
||||
} else if (this.visibleMedia.length > 0) {
|
||||
return 'media'
|
||||
} else if (this.users.length > 0) {
|
||||
return 'people'
|
||||
} else if (this.hashtags.length > 0) {
|
||||
return 'hashtags'
|
||||
const available = {
|
||||
statuses: this.visibleStatuses.length > 0,
|
||||
media: this.visibleMedia.length > 0,
|
||||
people: this.users.length > 0,
|
||||
hashtags: this.hashtags.length > 0,
|
||||
}
|
||||
|
||||
if (available[this.preferredTab]) {
|
||||
return this.preferredTab
|
||||
}
|
||||
|
||||
const tabOrder = ['statuses', 'media', 'people', 'hashtags']
|
||||
for (const tab of tabOrder) {
|
||||
if (available[tab]) {
|
||||
return tab
|
||||
}
|
||||
}
|
||||
|
||||
return 'statuses'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const StillImage = {
|
||||
props: [
|
||||
'loading',
|
||||
'src',
|
||||
'referrerpolicy',
|
||||
'mimetype',
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<img
|
||||
ref="src"
|
||||
:key="src"
|
||||
:loading="loading"
|
||||
:alt="alt"
|
||||
:title="alt"
|
||||
:src="src"
|
||||
|
|
Loading…
Reference in New Issue