Compare commits

...

2 Commits

4 changed files with 21 additions and 8 deletions

View File

@ -155,6 +155,7 @@
>
<StillImage
class="image"
:loading="'lazy'"
:referrerpolicy="referrerpolicy"
:mimetype="attachment.mimetype"
:src="attachment.large_thumb_url || attachment.url"

View File

@ -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'

View File

@ -1,5 +1,6 @@
const StillImage = {
props: [
'loading',
'src',
'referrerpolicy',
'mimetype',

View File

@ -12,6 +12,7 @@
<img
ref="src"
:key="src"
:loading="loading"
:alt="alt"
:title="alt"
:src="src"