From 0702934f4f05595194c73cc463b2e72a27e3b1e2 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 4 Mar 2020 00:23:14 +0200 Subject: fix trasparency problems in some cases (purple headers) --- src/services/theme_data/theme_data.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/services') diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index e6ff82e6..de6561cd 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -352,7 +352,8 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ } const opacitySlot = getOpacitySlot(key) const ownOpacitySlot = value.opacity - if (opacitySlot && (outputColor.a === undefined || ownOpacitySlot)) { + const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined + if (opacitySlot && (outputColor.a === undefined || opacityOverriden)) { const dependencySlot = deps[0] if (dependencySlot && colors[dependencySlot] === 'transparent') { outputColor.a = 0 -- cgit v1.2.3-70-g09d2 From 9f2c1b4008ef7bb77c98e80f75b41eaa9e92b90a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:17:24 +0200 Subject: fix several issues related to opacity --- src/services/theme_data/theme_data.service.js | 38 ++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'src/services') diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index de6561cd..c3fdbd87 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -350,17 +350,43 @@ 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 - const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined - if (opacitySlot && (outputColor.a === undefined || opacityOverriden)) { + + if (sourceColor === 'transparent') { + outputColor.a = 0 + } else if (ownOpacitySlot === null) { + outputColor.a = 1 + } 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 (opacitySlot) { return { colors: { ...colors, [key]: outputColor }, -- cgit v1.2.3-70-g09d2 From 7aa5bf0896c045d5d4a4e19fe7eff2c61fd2acf9 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:20:42 +0200 Subject: prioritize disabled opacity over transparent keyword --- src/services/theme_data/theme_data.service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/services') diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index c3fdbd87..44fb575c 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -354,10 +354,10 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ const opacitySlot = value.opacity || getOpacitySlot(key) const ownOpacitySlot = value.opacity - if (sourceColor === 'transparent') { - outputColor.a = 0 - } else if (ownOpacitySlot === null) { + if (ownOpacitySlot === null) { outputColor.a = 1 + } else if (sourceColor === 'transparent') { + outputColor.a = 0 } else { const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined -- cgit v1.2.3-70-g09d2 From 550080bd82bf39e35b2b481d8643bf1ac7461d7c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:39:17 +0200 Subject: fix last issue --- src/services/theme_data/theme_data.service.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/services') diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index 44fb575c..4d7e4f67 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -384,6 +384,9 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ : (OPACITIES[opacitySlot] || {}).defaultValue ) } + if (Number.isNaN(outputColor.a)) { + outputColor.a = 1 + } } } -- cgit v1.2.3-70-g09d2 From a485386a3b07f831859fcefa9cd429fc801fd8eb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:48:40 +0200 Subject: fix tests --- src/services/theme_data/theme_data.service.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/services') diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index 4d7e4f67..dd87e3cf 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -384,12 +384,13 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ : (OPACITIES[opacitySlot] || {}).defaultValue ) } - if (Number.isNaN(outputColor.a)) { - outputColor.a = 1 - } } } + if (Number.isNaN(outputColor.a) || outputColor.a === undefined) { + outputColor.a = 1 + } + if (opacitySlot) { return { colors: { ...colors, [key]: outputColor }, -- cgit v1.2.3-70-g09d2 From 40005240eb30ce59035299dc348a3962626e32c6 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 31 Mar 2020 14:46:38 -0500 Subject: Send credentials for favourited_by and reblogged_by API endpoints This ensures the data is fetchable on private instances --- src/services/api/api.service.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/services') 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 }) => { -- cgit v1.2.3-70-g09d2 From 18fa338d43b6b7b61b484ae6106ef3b95e5adeee Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 13 Apr 2020 15:26:55 +0400 Subject: Fix pagination --- src/services/api/api.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/services') diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 7db1d094..ad2b2ad5 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -540,7 +540,7 @@ const fetchTimeline = ({ params.push(['with_move', withMove]) } - params.push(['count', 20]) + params.push(['limit', 20]) params.push(['with_muted', withMuted]) const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&') -- cgit v1.2.3-70-g09d2 From 6bb75a3a6d8452a3e1b88085fe87cf27386f222c Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 21 Apr 2020 23:27:51 +0300 Subject: make relationships separate from users --- src/boot/after_store.js | 3 ++ src/components/account_actions/account_actions.js | 2 +- src/components/account_actions/account_actions.vue | 8 ++--- src/components/basic_user_card/basic_user_card.vue | 2 +- src/components/block_card/block_card.js | 5 ++- src/components/follow_button/follow_button.js | 14 ++++---- src/components/follow_card/follow_card.js | 3 ++ src/components/follow_card/follow_card.vue | 5 +-- src/components/mute_card/mute_card.js | 9 ++++-- src/components/notification/notification.js | 2 +- src/components/notification/notification.vue | 2 +- src/components/side_drawer/side_drawer.vue | 2 +- src/components/status/status.js | 15 +++++++-- src/components/status/status.vue | 2 +- src/components/user_card/user_card.js | 8 ++++- src/components/user_card/user_card.vue | 15 +++++---- src/components/user_panel/user_panel.vue | 2 +- src/components/user_profile/user_profile.vue | 2 +- src/components/user_settings/user_settings.js | 8 ++--- src/modules/users.js | 37 ++++++++-------------- src/services/api/api.service.js | 4 ++- .../entity_normalizer/entity_normalizer.service.js | 25 +++++++++------ .../follow_manipulate/follow_manipulate.js | 15 +++++---- .../notifications_fetcher.service.js | 1 - .../timeline_fetcher/timeline_fetcher.service.js | 2 ++ 25 files changed, 112 insertions(+), 81 deletions(-) (limited to 'src/services') diff --git a/src/boot/after_store.js b/src/boot/after_store.js index d70e1058..1522d4f0 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -304,6 +304,9 @@ const afterStoreSetup = async ({ store, i18n }) => { getNodeInfo({ store }) ]) + // Start fetching things that don't need to block the UI + store.dispatch('fetchMutes') + const router = new VueRouter({ mode: 'history', routes: routes(store), diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 5d7ecf7e..0826c275 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -3,7 +3,7 @@ import Popover from '../popover/popover.vue' const AccountActions = { props: [ - 'user' + 'user', 'relationship' ], data () { return { } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 483783cf..744b77d5 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -9,16 +9,16 @@ class="account-tools-popover" >