From bb02fadc163fef2a9d5844457a4146687609b718 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Tue, 20 Dec 2022 10:04:21 +0100 Subject: [PATCH 1/3] Remove schema when instance is being added for Pleroma --- src/utils/slices/instances/add.ts | 2 +- src/utils/slices/instancesSlice.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/slices/instances/add.ts b/src/utils/slices/instances/add.ts index e69e6c1e..fd3561d9 100644 --- a/src/utils/slices/instances/add.ts +++ b/src/utils/slices/instances/add.ts @@ -72,7 +72,7 @@ const addInstance = createAsyncThunk( appData, url: domain, token, - uri: instance.uri, + uri: instance.uri.replace(/^https?:\/\//, ''), // Pleroma includes schema urls: instance.urls, account: { id, diff --git a/src/utils/slices/instancesSlice.ts b/src/utils/slices/instancesSlice.ts index 4771b10e..7704cef9 100644 --- a/src/utils/slices/instancesSlice.ts +++ b/src/utils/slices/instancesSlice.ts @@ -280,7 +280,7 @@ export const getInstanceUrl = ({ instances: { instances } }: RootState) => instances[findInstanceActive(instances)]?.url export const getInstanceUri = ({ instances: { instances } }: RootState) => - instances[findInstanceActive(instances)]?.uri.replace(/^https?:\/\//, '') // Pleroma has schema + instances[findInstanceActive(instances)]?.uri export const getInstanceUrls = ({ instances: { instances } }: RootState) => instances[findInstanceActive(instances)]?.urls From dab2ca060d20cc99322b62bcb8963219373fa02e Mon Sep 17 00:00:00 2001 From: xmflsct Date: Tue, 20 Dec 2022 10:47:33 +0100 Subject: [PATCH 2/3] Fix visual bugs Somehow the `onError` of `react-native-fast-image` doesn't work anymore as expected. Maybe because the underlying `SDWebImage` is being patched to other versions. --- src/components/GracefullyImage.tsx | 20 ++---- src/components/Relationship/Outgoing.tsx | 11 +++- src/screens/Tabs/Shared/Account/Header.tsx | 18 ++---- .../Tabs/Shared/Account/Information.tsx | 62 ++++++++----------- .../Shared/Account/Information/Avatar.tsx | 25 +++----- 5 files changed, 54 insertions(+), 82 deletions(-) diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index f4c393e7..fd320107 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -53,26 +53,17 @@ const GracefullyImage = ({ }: Props) => { const { reduceMotionEnabled } = useAccessibility() const { colors } = useTheme() - const [originalFailed, setOriginalFailed] = useState(false) const [imageLoaded, setImageLoaded] = useState(false) - const source = originalFailed - ? { uri: uri.remote || undefined } - : { - uri: reduceMotionEnabled && uri.static ? uri.static : uri.original - } - + const source = { + uri: reduceMotionEnabled && uri.static ? uri.static : uri.original + } const onLoad = () => { setImageLoaded(true) if (setImageDimensions && source.uri) { Image.getSize(source.uri, (width, height) => setImageDimensions({ width, height })) } } - const onError = () => { - if (!originalFailed) { - setOriginalFailed(true) - } - } const blurhashView = useMemo(() => { if (hidden || !imageLoaded) { @@ -101,10 +92,11 @@ const GracefullyImage = ({ /> ) : null} {blurhashView} diff --git a/src/components/Relationship/Outgoing.tsx b/src/components/Relationship/Outgoing.tsx index fc082097..6d394b3f 100644 --- a/src/components/Relationship/Outgoing.tsx +++ b/src/components/Relationship/Outgoing.tsx @@ -13,6 +13,8 @@ import { useQueryClient } from '@tanstack/react-query' import { useSelector } from 'react-redux' import { checkInstanceFeature } from '@utils/slices/instancesSlice' import { StyleConstants } from '@utils/styles/constants' +import { View } from 'react-native' +import { useRoute } from '@react-navigation/native' export interface Props { id: Mastodon.Account['id'] @@ -122,9 +124,12 @@ const RelationshipOutgoing: React.FC = ({ id }: Props) => { } } + const { name } = useRoute() + const isPageNotifications = name === 'Tab-Notifications-Root' + return ( - <> - {canFollowNotify && query.data?.following ? ( + + {!isPageNotifications && canFollowNotify && query.data?.following ? (