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