aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/attachment/attachment.js4
-rw-r--r--src/components/attachment/attachment.scss7
-rw-r--r--src/components/attachment/attachment.vue5
-rw-r--r--src/components/gallery/gallery.js1
-rw-r--r--src/components/gallery/gallery.vue1
-rw-r--r--src/components/settings_modal/tabs/filtering_tab.js9
-rw-r--r--src/components/status/status.vue4
-rw-r--r--src/components/status_content/status_content.vue1
-rw-r--r--src/services/api/api.service.js30
9 files changed, 37 insertions, 25 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 5dc50475..6e14b24d 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -36,6 +36,7 @@ library.add(
const Attachment = {
props: [
'attachment',
+ 'compact',
'description',
'hideDescription',
'nsfw',
@@ -71,7 +72,8 @@ const Attachment = {
{
'-loading': this.loading,
'-nsfw-placeholder': this.hidden,
- '-editable': this.edit !== undefined
+ '-editable': this.edit !== undefined,
+ '-compact': this.compact
},
'-type-' + this.type,
this.size && '-size-' + this.size,
diff --git a/src/components/attachment/attachment.scss b/src/components/attachment/attachment.scss
index b2dea98d..966acc68 100644
--- a/src/components/attachment/attachment.scss
+++ b/src/components/attachment/attachment.scss
@@ -102,7 +102,6 @@
padding-top: 0.5em;
}
-
.play-icon {
position: absolute;
font-size: 64px;
@@ -265,4 +264,10 @@
object-fit: cover;
}
}
+
+ &.-compact {
+ .placeholder-container {
+ padding-bottom: 0.5em;
+ }
+ }
}
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 2a89886d..79f62806 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -162,10 +162,11 @@
target="_blank"
>
<FAIcon
- size="5x"
+ :size="compact ? '2x' : '5x'"
:icon="placeholderIconClass"
+ :title="localDescription"
/>
- <p>
+ <p v-if="!compact">
{{ localDescription }}
</p>
</a>
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js
index 4e1bda55..e86a3eea 100644
--- a/src/components/gallery/gallery.js
+++ b/src/components/gallery/gallery.js
@@ -4,6 +4,7 @@ import { sumBy, set } from 'lodash'
const Gallery = {
props: [
'attachments',
+ 'compact',
'limitRows',
'descriptions',
'limit',
diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue
index ccf6e3e2..bc18f545 100644
--- a/src/components/gallery/gallery.vue
+++ b/src/components/gallery/gallery.vue
@@ -20,6 +20,7 @@
v-for="(attachment, attachmentIndex) in row.items"
:key="attachment.id"
class="gallery-item"
+ :compact="compact"
:nsfw="nsfw"
:attachment="attachment"
:size="size"
diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js
index 5354e5db..7c37f0bc 100644
--- a/src/components/settings_modal/tabs/filtering_tab.js
+++ b/src/components/settings_modal/tabs/filtering_tab.js
@@ -1,4 +1,4 @@
-import { filter, trim } from 'lodash'
+import { filter, trim, debounce } from 'lodash'
import BooleanSetting from '../helpers/boolean_setting.vue'
import ChoiceSetting from '../helpers/choice_setting.vue'
import IntegerSetting from '../helpers/integer_setting.vue'
@@ -29,11 +29,16 @@ const FilteringTab = {
},
set (value) {
this.muteWordsStringLocal = value
+ this.debouncedSetMuteWords(value)
+ }
+ },
+ debouncedSetMuteWords () {
+ return debounce((value) => {
this.$store.dispatch('setOption', {
name: 'muteWords',
value: filter(value.split('\n'), (word) => trim(word).length > 0)
})
- }
+ }, 1000)
}
},
// Updating nested properties
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 82eb7ac6..f3bdb19d 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -84,7 +84,7 @@
:user="statusoid.user"
/>
<div class="right-side faint">
- <span
+ <bdi
class="status-username repeater-name"
:title="retweeter"
>
@@ -101,7 +101,7 @@
v-else
:to="retweeterProfileLink"
>{{ retweeter }}</router-link>
- </span>
+ </bdi>
{{ ' ' }}
<FAIcon
icon="retweet"
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index e2120f7a..c0e5c0b9 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -33,6 +33,7 @@
<gallery
v-if="status.attachments.length !== 0"
class="attachments media-body"
+ :compact="compact"
:nsfw="nsfwClickthrough"
:attachments="status.attachments"
:limit="compact ? 1 : 0"
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 00d1c020..af12265e 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -734,26 +734,22 @@ const fetchTimeline = ({
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
url += `?${queryString}`
- let status = ''
- let statusText = ''
-
- let pagination = {}
return fetch(url, { headers: authHeaders(credentials) })
- .then((data) => {
- status = data.status
- statusText = data.statusText
- pagination = parseLinkHeaderPagination(data.headers.get('Link'), {
- flakeId: timeline !== 'bookmarks' && timeline !== 'notifications'
- })
- return data
- })
- .then((data) => data.json())
- .then((data) => {
- if (!data.errors) {
+ .then(async (response) => {
+ const success = response.ok
+
+ const data = await response.json()
+
+ if (success && !data.errors) {
+ const pagination = parseLinkHeaderPagination(response.headers.get('Link'), {
+ flakeId: timeline !== 'bookmarks' && timeline !== 'notifications'
+ })
+
return { data: data.map(isNotifications ? parseNotification : parseStatus), pagination }
} else {
- data.status = status
- data.statusText = statusText
+ data.errors ||= []
+ data.status = response.status
+ data.statusText = response.statusText
return data
}
})