1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Merge branch 'main' into candidate

This commit is contained in:
xmflsct
2023-02-01 00:15:54 +01:00
5 changed files with 21 additions and 13 deletions

View File

@ -131,7 +131,7 @@ const EmojisList = () => {
> >
<FastImage <FastImage
enterTransition='fadeIn' enterTransition='fadeIn'
transitionDuration={100} transitionDuration={60}
accessibilityLabel={t('common:customEmoji.accessibilityLabel', { accessibilityLabel={t('common:customEmoji.accessibilityLabel', {
emoji: emoji.shortcode emoji: emoji.shortcode
})} })}

View File

@ -88,21 +88,21 @@ const GracefullyImage = ({
{...(onPress ? { accessibilityRole: 'imagebutton' } : { accessibilityRole: 'image' })} {...(onPress ? { accessibilityRole: 'imagebutton' } : { accessibilityRole: 'image' })}
accessibilityLabel={accessibilityLabel} accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint} accessibilityHint={accessibilityHint}
style={[style, dimension, { backgroundColor: colors.shimmerDefault }]} style={[style, dimension]}
{...(onPress ? (hidden ? { disabled: true } : { onPress }) : { disabled: true })} {...(onPress ? (hidden ? { disabled: true } : { onPress }) : { disabled: true })}
> >
{uri.preview && !imageLoaded ? ( {uri.preview && !imageLoaded ? (
<FastImage <FastImage
source={connectMedia({ uri: uri.preview })} source={connectMedia({ uri: uri.preview })}
enterTransition='fadeIn' enterTransition='fadeIn'
transitionDuration={100} transitionDuration={60}
style={[styles.placeholder, { backgroundColor: colors.shimmerDefault }]} style={[styles.placeholder]}
/> />
) : null} ) : null}
<FastImage <FastImage
source={connectMedia(source)} source={connectMedia(source)}
enterTransition='fadeIn' enterTransition='fadeIn'
transitionDuration={100} transitionDuration={60}
style={[{ flex: 1 }, imageStyle]} style={[{ flex: 1 }, imageStyle]}
onLoad={() => { onLoad={() => {
setImageLoaded(true) setImageLoaded(true)

View File

@ -186,7 +186,7 @@ const ComponentInstance: React.FC<Props> = ({
if (!account) { if (!account) {
setGlobalStorage('accounts', (accounts || []).concat([accountKey])) setGlobalStorage('accounts', (accounts || []).concat([accountKey]))
} }
setAccount(accountKey) await setAccount(accountKey)
goBack && navigation.goBack() goBack && navigation.goBack()
} }

View File

@ -106,7 +106,7 @@ const ComposeAttachments: React.FC<Props> = ({ accessibleRefAttachments }) => {
> >
<FastImage <FastImage
enterTransition='fadeIn' enterTransition='fadeIn'
transitionDuration={100} transitionDuration={60}
style={{ width: '100%', height: '100%' }} style={{ width: '100%', height: '100%' }}
source={ source={
item.local?.thumbnail item.local?.thumbnail

View File

@ -33,9 +33,13 @@ export const getGlobalStorage = {
object: <T extends keyof StorageGlobal>(key: T) => { object: <T extends keyof StorageGlobal>(key: T) => {
const value = storage.global.getString(key) const value = storage.global.getString(key)
if (value?.length) { if (value?.length) {
return JSON.parse(value) as NonNullable<StorageGlobal[T]> extends object try {
? StorageGlobal[T] return JSON.parse(value) as NonNullable<StorageGlobal[T]> extends object
: never ? StorageGlobal[T]
: never
} catch {
return undefined
}
} else { } else {
return undefined return undefined
} }
@ -108,9 +112,13 @@ export const getAccountStorage = {
object: <T extends keyof StorageAccount>(key: T) => { object: <T extends keyof StorageAccount>(key: T) => {
const value = storage.account?.getString(key) const value = storage.account?.getString(key)
if (value?.length) { if (value?.length) {
return JSON.parse(value) as NonNullable<StorageAccount[T]> extends object try {
? StorageAccount[T] return JSON.parse(value) as NonNullable<StorageAccount[T]> extends object
: never ? StorageAccount[T]
: never
} catch {
return undefined
}
} else { } else {
return undefined return undefined
} }