Fixes after upgrades

This commit is contained in:
Zhiyuan Zheng 2022-05-08 23:40:42 +02:00
parent 1d6790c76e
commit d9e1530b8b
23 changed files with 67 additions and 63 deletions

View File

@ -37,6 +37,7 @@ export default (): ExpoConfig => ({
android: {
package: 'com.xmflsct.app.tooot',
googleServicesFile: './configs/google-services.json',
permissions: ['CAMERA', 'VIBRATE']
permissions: ['CAMERA', 'VIBRATE'],
blockedPermissions: ['USE_BIOMETRIC', 'USE_FINGERPRINT']
}
})

View File

@ -1,6 +1,6 @@
import Button from '@components/Button'
import { StyleConstants } from '@utils/styles/constants'
import { Video } from 'expo-av'
import { ResizeMode, Video, VideoFullscreenUpdate } from 'expo-av'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import {
AppState,
@ -110,15 +110,14 @@ const AttachmentVideo: React.FC<Props> = ({
source: { uri: video.url }
}
: {
resizeMode: 'cover',
resizeMode: ResizeMode.COVER,
posterSource: { uri: video.preview_url },
posterStyle: { resizeMode: 'cover' }
posterStyle: { resizeMode: ResizeMode.COVER }
})}
useNativeControls={false}
onFullscreenUpdate={async event => {
if (
event.fullscreenUpdate ===
Video.FULLSCREEN_UPDATE_PLAYER_DID_DISMISS
event.fullscreenUpdate === VideoFullscreenUpdate.PLAYER_DID_DISMISS
) {
if (gifv) {
await videoPlayer.current?.pauseAsync()

View File

@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
export interface Props {
status: Pick<
Mastodon.Status,
'content' | 'spoiler_text' | 'emojis' | 'mentions' | 'tags'
>
status: Pick<Mastodon.Status, 'content' | 'spoiler_text' | 'emojis'> & {
mentions?: Mastodon.Status['mentions']
tags?: Mastodon.Status['tags']
}
numberOfLines?: number
highlighted?: boolean
disableDetails?: boolean

View File

@ -9,11 +9,11 @@ import { FormattedDate, FormattedRelativeTime, FormattedTime } from 'react-intl'
export interface Props {
created_at: Mastodon.Status['created_at'] | number
edited_at?: Mastodon.Status['edited_at']
highlighted: boolean
highlighted?: boolean
}
const HeaderSharedCreated = React.memo(
({ created_at, edited_at, highlighted }: Props) => {
({ created_at, edited_at, highlighted = false }: Props) => {
const { t } = useTranslation('componentTimeline')
const { colors } = useTheme()

View File

@ -4,7 +4,6 @@ import haptics from '@components/haptics'
import Icon from '@components/Icon'
import { displayMessage } from '@components/Message'
import { ParseEmojis } from '@components/Parse'
import RelativeTime from '@components/RelativeTime'
import CustomText from '@components/Text'
import {
MutationVarsTimelineUpdateStatusProperty,

View File

@ -2,7 +2,10 @@ import analytics from '@components/analytics'
import { ActionSheetOptions } from '@expo/react-native-action-sheet'
import * as ImageManipulator from 'expo-image-manipulator'
import * as ImagePicker from 'expo-image-picker'
import { ImageInfo } from 'expo-image-picker/build/ImagePicker.types'
import {
ImageInfo,
UIImagePickerPresentationStyle
} from 'expo-image-picker/build/ImagePicker.types'
import i18next from 'i18next'
import { Alert, Linking, Platform } from 'react-native'
@ -39,7 +42,7 @@ const mediaSelector = async ({
{ resize }
])
}
resolve(newResult)
resolve({ ...newResult, cancelled: false })
} else {
resolve(result)
}
@ -94,8 +97,8 @@ const mediaSelector = async ({
exif: false,
presentationStyle:
Platform.OS === 'ios' && parseInt(Platform.Version) < 13
? 0
: -2
? UIImagePickerPresentationStyle.FULL_SCREEN
: UIImagePickerPresentationStyle.AUTOMATIC
})
if (!result.cancelled) {

View File

@ -34,6 +34,7 @@ const openLink = async (url: string, navigation?: any) => {
// @ts-ignore
navigation.push(page, options)
} else {
// @ts-ignore
navigationRef.navigate(page, options)
}
}

View File

@ -62,8 +62,8 @@
"history": {
"accessibilityLabel": "Dieser Tröt wurde {{count}} mal bearbeitet",
"accessibilityHint": "Für den vollständigen Verlauf auswählen",
"text": "{{count}} bearbeitet",
"text_plural": "{{count}} mal bearbeitet"
"text_one": "{{count}} bearbeitet",
"text_other": "{{count}} mal bearbeitet"
}
},
"attachment": {
@ -219,10 +219,10 @@
"refresh": "Aktualisieren"
},
"count": {
"voters": "{{count}} Benutzer haben abgestimmt",
"voters_plural": "{{count}} Benutzer haben abgestimmt",
"votes": "{{count}} Stimmen",
"votes_plural": "{{count}} Stimmen"
"voters_one": "{{count}} Benutzer haben abgestimmt",
"voters_other": "{{count}} Benutzer haben abgestimmt",
"votes_one": "{{count}} Stimmen",
"votes_other": "{{count}} Stimmen"
},
"expiration": {
"expired": "Abstimmung abgelaufen",

View File

@ -62,8 +62,8 @@
"history": {
"accessibilityLabel": "This toot has been edited {{count}} times",
"accessibilityHint": "Tap to view the full edit history",
"text": "{{count}} edit",
"text_plural": "{{count}} edits"
"text_one": "{{count}} edit",
"text_other": "{{count}} edits"
}
},
"attachment": {
@ -219,10 +219,10 @@
"refresh": "Refresh"
},
"count": {
"voters": "{{count}} user voted",
"voters_plural": "{{count}} users voted",
"votes": "{{count}} vote",
"votes_plural": "{{count}} votes"
"voters_one": "{{count}} user voted",
"voters_other": "{{count}} users voted",
"votes_one": "{{count}} vote",
"votes_other": "{{count}} votes"
},
"expiration": {
"expired": "Vote expired",

View File

@ -142,8 +142,8 @@
"accessibilityHint": "Open emoji selection panel, swipe horizontally to change page"
}
},
"drafts": "Draft ({{count}})",
"drafts_plural": "Drafts ({{count}})"
"drafts_one": "Draft ({{count}})",
"drafts_other": "Drafts ({{count}})"
},
"editAttachment": {
"header": {

View File

@ -116,8 +116,8 @@
},
"fields": {
"title": "Metadata",
"total": "{{count}} field",
"total_plural": "{{count}} fields"
"total_one": "{{count}} field",
"total_other": "{{count}} fields"
},
"visibility": {
"title": "Posting Visibility",

View File

@ -196,10 +196,10 @@
"refresh": "새로고침"
},
"count": {
"voters": "{{count}}명의 사용자가 투표",
"voters_plural": "{{count}}명의 사용자가 투표",
"votes": "{{count}} 투표",
"votes_plural": "{{count}} 투표"
"voters_one": "{{count}}명의 사용자가 투표",
"voters_other": "{{count}}명의 사용자가 투표",
"votes_one": "{{count}} 투표",
"votes_other": "{{count}} 투표"
},
"expiration": {
"expired": "투표 종료됨",

View File

@ -134,8 +134,8 @@
"accessibilityHint": "이모지 선택 패널 열기, 가로로 스와이프해서 페이지를 바꿀 수 있어요"
}
},
"drafts": "초안 ({{count}})",
"drafts_plural": "초안 ({{count}})"
"drafts_one": "초안 ({{count}})",
"drafts_other": "초안 ({{count}})"
},
"editAttachment": {
"header": {

View File

@ -113,8 +113,8 @@
},
"fields": {
"title": "메타데이터",
"total": "{{count}}개 필드",
"total_plural": "{{count}}개 필드"
"total_one": "{{count}}개 필드",
"total_other": "{{count}}개 필드"
},
"visibility": {
"title": "공개 범위",

View File

@ -198,10 +198,10 @@
"refresh": "Làm mới"
},
"count": {
"voters": "{{count}} người bình chọn",
"voters_plural": "{{count}} người bình chọn",
"votes": "{{count}} bình chọn",
"votes_plural": "{{count}} bình chọn"
"voters_one": "{{count}} người bình chọn",
"voters_other": "{{count}} người bình chọn",
"votes_one": "{{count}} bình chọn",
"votes_other": "{{count}} bình chọn"
},
"expiration": {
"expired": "Đã kết thúc",

View File

@ -134,8 +134,8 @@
"accessibilityHint": "Mở bảng chọn emoji, vuốt qua lại để xem toàn bộ"
}
},
"drafts": "Nháp ({{count}})",
"drafts_plural": "Nháp ({{count}})"
"drafts_one": "Nháp ({{count}})",
"drafts_other": "Nháp ({{count}})"
},
"editAttachment": {
"header": {

View File

@ -116,8 +116,8 @@
},
"fields": {
"title": "Metadata",
"total": "{{count}} mục",
"total_plural": "{{count}} mục"
"total_one": "{{count}} mục",
"total_other": "{{count}} mục"
},
"visibility": {
"title": "Kiểu tút mặc định",

View File

@ -198,10 +198,10 @@
"refresh": "刷新"
},
"count": {
"voters": "已投{{count}}人",
"voters_plural": "已投{{count}}人",
"votes": "{{count}}票",
"votes_plural": "{{count}}票"
"voters_one": "已投{{count}}人",
"voters_other": "已投{{count}}人",
"votes_one": "{{count}}票",
"votes_other": "{{count}}票"
},
"expiration": {
"expired": "投票已结束",
@ -210,4 +210,4 @@
}
}
}
}
}

View File

@ -136,8 +136,8 @@
"accessibilityHint": "打开表情选择面板,水平滑动切换页面"
}
},
"drafts": "草稿 ({{count}})",
"drafts_plural": "草稿 ({{count}})"
"drafts_one": "草稿 ({{count}})",
"drafts_other": "草稿 ({{count}})"
},
"editAttachment": {
"header": {

View File

@ -116,8 +116,8 @@
},
"fields": {
"title": "附加信息",
"total": "{{count}} 项",
"total_plural": "{{count}} 项"
"total_one": "{{count}} 项",
"total_other": "{{count}} 项"
},
"visibility": {
"title": "嘟文默认可见范围",

View File

@ -2,7 +2,6 @@ import analytics from '@components/analytics'
import Button from '@components/Button'
import haptics from '@components/haptics'
import { ParseHTML } from '@components/Parse'
import RelativeTime from '@components/RelativeTime'
import CustomText from '@components/Text'
import { BlurView } from '@react-native-community/blur'
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'

View File

@ -7,6 +7,7 @@
*/
import GracefullyImage from '@components/GracefullyImage'
import { RootStackParamList } from '@utils/navigation/navigators'
import React, { useState, useCallback } from 'react'
import { Animated, Dimensions, StyleSheet } from 'react-native'
import usePanResponder from '../hooks/usePanResponder'
@ -17,11 +18,11 @@ const SCREEN_WIDTH = SCREEN.width
const SCREEN_HEIGHT = SCREEN.height
type Props = {
imageSrc: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
imageSrc: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
onRequestClose: () => void
onZoom: (isZoomed: boolean) => void
onLongPress: (
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
image: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
) => void
delayLongPress: number
swipeToCloseEnabled?: boolean

View File

@ -7,6 +7,7 @@
*/
import GracefullyImage from '@components/GracefullyImage'
import { RootStackParamList } from '@utils/navigation/navigators'
import React, { createRef, useCallback, useRef, useState } from 'react'
import {
Animated,
@ -31,11 +32,11 @@ const SCREEN_WIDTH = SCREEN.width
const SCREEN_HEIGHT = SCREEN.height
type Props = {
imageSrc: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
imageSrc: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
onRequestClose: () => void
onZoom: (scaled: boolean) => void
onLongPress: (
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
image: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
) => void
swipeToCloseEnabled?: boolean
}