aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/components/notifications/notifications.scss1
-rw-r--r--src/components/registration/registration.vue3
-rw-r--r--src/components/status_popover/status_popover.js7
-rw-r--r--src/components/status_popover/status_popover.vue10
-rw-r--r--src/i18n/en.json3
-rw-r--r--src/i18n/fi.json3
-rw-r--r--src/modules/config.js1
-rw-r--r--src/modules/statuses.js2
-rw-r--r--src/services/api/api.service.js16
-rw-r--r--src/services/theme_data/theme_data.service.js41
11 files changed, 74 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1677a5ba..24c193b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Notifications column now cleans itself up to optimize performance when tab is left open for a long time
- 403 messaging
### Fixed
+- Fixed loader-spinner not disappearing when a status preview fails to load
- anon viewers won't get theme data saved to local storage, so admin changing default theme will have an effect for users coming back to instance.
- Single notifications left unread when hitting read on another device/tab
- Registration fixed
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss
index f5b13322..a8f4430f 100644
--- a/src/components/notifications/notifications.scss
+++ b/src/components/notifications/notifications.scss
@@ -81,6 +81,7 @@
.follow-text, .move-text {
padding: 0.5em 0;
+ overflow-wrap: break-word;
}
.status-el {
diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue
index fdbda007..a83ca1e5 100644
--- a/src/components/registration/registration.vue
+++ b/src/components/registration/registration.vue
@@ -187,6 +187,9 @@
class="form-control"
type="text"
autocomplete="off"
+ autocorrect="off"
+ autocapitalize="off"
+ spellcheck="false"
>
</template>
</div>
diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js
index cb55f67e..159132a9 100644
--- a/src/components/status_popover/status_popover.js
+++ b/src/components/status_popover/status_popover.js
@@ -5,6 +5,11 @@ const StatusPopover = {
props: [
'statusId'
],
+ data () {
+ return {
+ error: false
+ }
+ },
computed: {
status () {
return find(this.$store.state.statuses.allStatuses, { id: this.statusId })
@@ -18,6 +23,8 @@ const StatusPopover = {
enter () {
if (!this.status) {
this.$store.dispatch('fetchStatus', this.statusId)
+ .then(data => (this.error = false))
+ .catch(e => (this.error = true))
}
}
}
diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue
index 11f6cb5a..f5948207 100644
--- a/src/components/status_popover/status_popover.vue
+++ b/src/components/status_popover/status_popover.vue
@@ -18,8 +18,14 @@
:compact="true"
/>
<div
+ v-else-if="error"
+ class="status-preview-no-content faint"
+ >
+ {{ $t('status.status_unavailable') }}
+ </div>
+ <div
v-else
- class="status-preview-loading"
+ class="status-preview-no-content"
>
<i class="icon-spin4 animate-spin" />
</div>
@@ -50,7 +56,7 @@
border: none;
}
- .status-preview-loading {
+ .status-preview-no-content {
padding: 1em;
text-align: center;
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 82acc1ab..54d0608e 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -615,7 +615,8 @@
"reply_to": "Reply to",
"replies_list": "Replies:",
"mute_conversation": "Mute conversation",
- "unmute_conversation": "Unmute conversation"
+ "unmute_conversation": "Unmute conversation",
+ "status_unavailable": "Status unavailable"
},
"user_card": {
"approve": "Approve",
diff --git a/src/i18n/fi.json b/src/i18n/fi.json
index ac8b2ac9..926e6087 100644
--- a/src/i18n/fi.json
+++ b/src/i18n/fi.json
@@ -289,7 +289,8 @@
"reply_to": "Vastaus",
"replies_list": "Vastaukset:",
"mute_conversation": "Hiljennä keskustelu",
- "unmute_conversation": "Poista hiljennys"
+ "unmute_conversation": "Poista hiljennys",
+ "status_unavailable": "Viesti ei saatavissa"
},
"user_card": {
"approve": "Hyväksy",
diff --git a/src/modules/config.js b/src/modules/config.js
index e6b373b4..7997521d 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -102,6 +102,7 @@ const config = {
setPreset(value)
break
case 'customTheme':
+ case 'customThemeSource':
applyTheme(value)
}
}
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 25b62ac7..f1b7dcbd 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -616,7 +616,7 @@ const statuses = {
commit('setNotificationsSilence', { value })
},
fetchStatus ({ rootState, dispatch }, id) {
- rootState.api.backendInteractor.fetchStatus({ id })
+ return rootState.api.backendInteractor.fetchStatus({ id })
.then((status) => dispatch('addNewStatuses', { statuses: [status] }))
},
deleteStatus ({ rootState, commit }, status) {
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 03e88ae2..7db1d094 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -880,12 +880,20 @@ const fetchPoll = ({ pollId, credentials }) => {
)
}
-const fetchFavoritedByUsers = ({ id }) => {
- return promisedRequest({ url: MASTODON_STATUS_FAVORITEDBY_URL(id) }).then((users) => users.map(parseUser))
+const fetchFavoritedByUsers = ({ id, credentials }) => {
+ return promisedRequest({
+ url: MASTODON_STATUS_FAVORITEDBY_URL(id),
+ method: 'GET',
+ credentials
+ }).then((users) => users.map(parseUser))
}
-const fetchRebloggedByUsers = ({ id }) => {
- return promisedRequest({ url: MASTODON_STATUS_REBLOGGEDBY_URL(id) }).then((users) => users.map(parseUser))
+const fetchRebloggedByUsers = ({ id, credentials }) => {
+ return promisedRequest({
+ url: MASTODON_STATUS_REBLOGGEDBY_URL(id),
+ method: 'GET',
+ credentials
+ }).then((users) => users.map(parseUser))
}
const fetchEmojiReactions = ({ id, credentials }) => {
diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js
index e6ff82e6..dd87e3cf 100644
--- a/src/services/theme_data/theme_data.service.js
+++ b/src/services/theme_data/theme_data.service.js
@@ -350,16 +350,47 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({
if (!outputColor) {
throw new Error('Couldn\'t generate color for ' + key)
}
- const opacitySlot = getOpacitySlot(key)
+
+ const opacitySlot = value.opacity || getOpacitySlot(key)
const ownOpacitySlot = value.opacity
- if (opacitySlot && (outputColor.a === undefined || ownOpacitySlot)) {
+
+ if (ownOpacitySlot === null) {
+ outputColor.a = 1
+ } else if (sourceColor === 'transparent') {
+ outputColor.a = 0
+ } else {
+ const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined
+
const dependencySlot = deps[0]
- if (dependencySlot && colors[dependencySlot] === 'transparent') {
- outputColor.a = 0
+ const dependencyColor = dependencySlot && colors[dependencySlot]
+
+ if (!ownOpacitySlot && dependencyColor && !value.textColor && ownOpacitySlot !== null) {
+ // Inheriting color from dependency (weird, i know)
+ // except if it's a text color or opacity slot is set to 'null'
+ outputColor.a = dependencyColor.a
+ } else if (!dependencyColor && !opacitySlot) {
+ // Remove any alpha channel if no dependency and no opacitySlot found
+ delete outputColor.a
} else {
- outputColor.a = Number(sourceOpacity[opacitySlot]) || OPACITIES[opacitySlot].defaultValue || 1
+ // Otherwise try to assign opacity
+ if (dependencyColor && dependencyColor.a === 0) {
+ // transparent dependency shall make dependents transparent too
+ outputColor.a = 0
+ } else {
+ // Otherwise check if opacity is overriden and use that or default value instead
+ outputColor.a = Number(
+ opacityOverriden
+ ? sourceOpacity[opacitySlot]
+ : (OPACITIES[opacitySlot] || {}).defaultValue
+ )
+ }
}
}
+
+ if (Number.isNaN(outputColor.a) || outputColor.a === undefined) {
+ outputColor.a = 1
+ }
+
if (opacitySlot) {
return {
colors: { ...colors, [key]: outputColor },