From b8f5da10928183e9d24046d866dfc6b5c99cdb3e Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 16 Apr 2021 00:56:35 +0200 Subject: [PATCH 1/7] Replace previous screenshots for iOS --- fastlane/Deliverfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastlane/Deliverfile b/fastlane/Deliverfile index 8a115902..079a7135 100644 --- a/fastlane/Deliverfile +++ b/fastlane/Deliverfile @@ -18,4 +18,5 @@ primary_category("SOCIAL_NETWORKING") automatic_release(false) force(true) precheck_include_in_app_purchases(false) -submit_for_review(true) \ No newline at end of file +submit_for_review(true) +overwrite_screenshots(true) \ No newline at end of file From 292101ab30e98cf53b39a6e3d47ea53ff0d91b2d Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 19 Apr 2021 11:34:50 +0200 Subject: [PATCH 2/7] Fixed #106 --- src/screens/ImageViewer/save.ts | 4 +++- src/screens/ImagesViewer.tsx | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/screens/ImageViewer/save.ts b/src/screens/ImageViewer/save.ts index aa72e4f2..ff2689b5 100644 --- a/src/screens/ImageViewer/save.ts +++ b/src/screens/ImageViewer/save.ts @@ -6,7 +6,9 @@ const saveIos = async ( image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0] ) => { CameraRoll.save(image.url) - .then(() => haptics('Success')) + .then(() => { + haptics('Success') + }) .catch(() => { if (image.remote_url) { CameraRoll.save(image.remote_url) diff --git a/src/screens/ImagesViewer.tsx b/src/screens/ImagesViewer.tsx index ed4eded8..2550d325 100644 --- a/src/screens/ImagesViewer.tsx +++ b/src/screens/ImagesViewer.tsx @@ -11,15 +11,19 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import ImageViewer from './ImageViewer/Root' +import { saveAndroid, saveIos } from './ImageViewer/save' const saveImage = async ( image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0] ) => { - const save = require('./ImageViewer/save') - Platform.select({ - ios: save.saveIos(image), - android: save.saveAndroid(image) - }) + switch (Platform.OS) { + case 'ios': + saveIos(image) + break + case 'android': + saveAndroid(image) + break + } } const HeaderComponent = React.memo( From 7a12792393362b70b2cff0bc9b31762519860c21 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 19 Apr 2021 17:15:52 +0200 Subject: [PATCH 3/7] Fixed #107 --- src/@types/react-navigation.d.ts | 1 + src/components/GracefullyImage.tsx | 23 ++++++++++++++----- src/components/Timeline/Shared/Attachment.tsx | 2 ++ .../components/ImageItem.android.tsx | 2 +- .../ImageViewer/components/ImageItem.ios.tsx | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/@types/react-navigation.d.ts b/src/@types/react-navigation.d.ts index acf59127..f90844f0 100644 --- a/src/@types/react-navigation.d.ts +++ b/src/@types/react-navigation.d.ts @@ -57,6 +57,7 @@ declare namespace Nav { 'Screen-ImagesViewer': { imageUrls: { id: Mastodon.Attachment['id'] + preview_url: Mastodon.AttachmentImage['preview_url'] url: Mastodon.AttachmentImage['url'] remote_url?: Mastodon.AttachmentImage['remote_url'] blurhash: Mastodon.AttachmentImage['blurhash'] diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index 37cac47f..dcacb0dd 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -81,13 +81,17 @@ const GracefullyImage = React.memo( const previewView = useMemo( () => - uri.preview && !imageLoaded ? ( + // Android flickrs between transition, thus keep showing the preview image + uri.preview ? ( ) : null, - [imageLoaded] + [] ) const originalView = useMemo( () => ( @@ -104,12 +108,19 @@ const GracefullyImage = React.memo( if (hidden || !imageLoaded) { if (blurhash) { return ( - + ) } else { return ( ) } @@ -146,7 +157,7 @@ const GracefullyImage = React.memo( ) const styles = StyleSheet.create({ - blurhash: { + placeholder: { width: '100%', height: '100%', position: 'absolute' diff --git a/src/components/Timeline/Shared/Attachment.tsx b/src/components/Timeline/Shared/Attachment.tsx index 0b91ae47..e6925ae5 100644 --- a/src/components/Timeline/Shared/Attachment.tsx +++ b/src/components/Timeline/Shared/Attachment.tsx @@ -47,6 +47,7 @@ const TimelineAttachment = React.memo( case 'image': imageUrls.push({ id: attachment.id, + preview_url: attachment.preview_url, url: attachment.url, remote_url: attachment.remote_url, blurhash: attachment.blurhash, @@ -107,6 +108,7 @@ const TimelineAttachment = React.memo( ) { imageUrls.push({ id: attachment.id, + preview_url: attachment.preview_url, url: attachment.url, remote_url: attachment.remote_url, blurhash: attachment.blurhash, diff --git a/src/screens/ImageViewer/components/ImageItem.android.tsx b/src/screens/ImageViewer/components/ImageItem.android.tsx index e5cb50b6..3974861b 100644 --- a/src/screens/ImageViewer/components/ImageItem.android.tsx +++ b/src/screens/ImageViewer/components/ImageItem.android.tsx @@ -90,10 +90,10 @@ const ImageItem = ({ children={ Date: Mon, 19 Apr 2021 17:35:01 +0200 Subject: [PATCH 4/7] Fixed #105 --- src/screens/Tabs/Me/Settings/Tooot.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/screens/Tabs/Me/Settings/Tooot.tsx b/src/screens/Tabs/Me/Settings/Tooot.tsx index 35194f39..1315c1fe 100644 --- a/src/screens/Tabs/Me/Settings/Tooot.tsx +++ b/src/screens/Tabs/Me/Settings/Tooot.tsx @@ -2,7 +2,6 @@ import analytics from '@components/analytics' import Icon from '@components/Icon' import { MenuContainer, MenuRow } from '@components/Menu' import { useNavigation } from '@react-navigation/native' -import { useSearchQuery } from '@utils/queryHooks/search' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import * as Updates from 'expo-updates' @@ -20,11 +19,6 @@ const SettingsTooot: React.FC = () => { const { theme } = useTheme() const { t } = useTranslation('screenTabs') - const { isLoading, data } = useSearchQuery({ - term: '@tooot@xmflsct.com', - options: { enabled: instanceActive !== -1 } - }) - return ( { ) : null} { } iconBack='ChevronRight' onPress={() => { - const foundAccounts = data?.accounts.filter( - account => - account.acct === 'tooot@xmflsct.com' || - account.url === 'https://social.xmflsct.com/@tooot' - ) - if (foundAccounts?.length === 1) { + if (instanceActive !== -1) { navigation.navigate('Screen-Compose', { type: 'conversation', - accts: [foundAccounts[0].acct] + accts: ['tooot@xmflsct.com'] }) } else { WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot') From 1ee9b7d91d7f6d12317b81daaecf474d557968cd Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 19 Apr 2021 22:50:55 +0200 Subject: [PATCH 5/7] Fixed #109 --- src/components/GracefullyImage.tsx | 9 +++++---- src/screens/ImagesViewer.tsx | 1 + src/startup/audio.ts | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index dcacb0dd..62027dfb 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -67,8 +67,8 @@ const GracefullyImage = React.memo( setImageLoaded(true) setImageDimensions && setImageDimensions({ - width: nativeEvent.width, - height: nativeEvent.height + width: nativeEvent.source.width, + height: nativeEvent.source.height }) }, [source.uri] @@ -81,9 +81,9 @@ const GracefullyImage = React.memo( const previewView = useMemo( () => - // Android flickrs between transition, thus keep showing the preview image - uri.preview ? ( + uri.preview && !imageLoaded ? ( ( { if (imageUrls.length === 0) { + navigation.goBack() return null } diff --git a/src/startup/audio.ts b/src/startup/audio.ts index cfe6e475..f92dc883 100644 --- a/src/startup/audio.ts +++ b/src/startup/audio.ts @@ -7,8 +7,7 @@ const audio = () => { playsInSilentModeIOS: true, interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX, interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX, - shouldDuckAndroid: true, - playThroughEarpieceAndroid: true + shouldDuckAndroid: true }) } From 0941fb04e9acc1d7b217a7ef74e2ea2b2f4db192 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Mon, 19 Apr 2021 22:59:10 +0200 Subject: [PATCH 6/7] Fix in some rare cases --- package.json | 2 +- src/components/Parse/HTML.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2de1612d..5079cca4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "210317", "major": 1, "minor": 0, - "patch": 0, + "patch": 1, "expo": "40.0.0" }, "description": "tooot app for Mastodon", diff --git a/src/components/Parse/HTML.tsx b/src/components/Parse/HTML.tsx index ddbc8e7a..4d0589be 100644 --- a/src/components/Parse/HTML.tsx +++ b/src/components/Parse/HTML.tsx @@ -128,7 +128,8 @@ const renderNode = ({ }) }} > - {content || (showFullLink ? href : domain[1])} + {(content && content !== href && content) || + (showFullLink ? href : domain[1])} {!shouldBeTag ? ( Date: Mon, 19 Apr 2021 23:25:53 +0200 Subject: [PATCH 7/7] Revert back minor --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5079cca4..2de1612d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "210317", "major": 1, "minor": 0, - "patch": 1, + "patch": 0, "expo": "40.0.0" }, "description": "tooot app for Mastodon",