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
enterTransition='fadeIn'
transitionDuration={100}
transitionDuration={60}
accessibilityLabel={t('common:customEmoji.accessibilityLabel', {
emoji: emoji.shortcode
})}

View File

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

View File

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

View File

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

View File

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