mirror of https://github.com/tooot-app/app
Fixed #93
This commit is contained in:
parent
5a45e1d0dc
commit
cf33c52e49
|
@ -6,6 +6,7 @@ import {
|
|||
Pressable,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
View,
|
||||
ViewStyle
|
||||
} from 'react-native'
|
||||
import { Blurhash } from 'react-native-blurhash'
|
||||
|
@ -94,9 +95,24 @@ const GracefullyImage = React.memo(
|
|||
[source]
|
||||
)
|
||||
const blurhashView = useMemo(() => {
|
||||
return blurhash && (hidden || !imageLoaded) ? (
|
||||
<Blurhash decodeAsync blurhash={blurhash} style={styles.blurhash} />
|
||||
) : null
|
||||
if (hidden || !imageLoaded) {
|
||||
if (blurhash) {
|
||||
return (
|
||||
<Blurhash decodeAsync blurhash={blurhash} style={styles.blurhash} />
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.blurhash,
|
||||
{ backgroundColor: theme.disabled }
|
||||
]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}, [hidden, imageLoaded])
|
||||
|
||||
return (
|
||||
|
|
|
@ -69,7 +69,7 @@ const ParseEmojis = React.memo(
|
|||
return emojiShortcode === `:${emoji.shortcode}:`
|
||||
})
|
||||
if (emojiIndex === -1) {
|
||||
return <Text>{emojiShortcode}</Text>
|
||||
return <Text key={emojiShortcode}>{emojiShortcode}</Text>
|
||||
} else {
|
||||
if (i === 0) {
|
||||
return <Text key={emojiShortcode}> </Text>
|
||||
|
|
|
@ -195,7 +195,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
|||
const autoSave = composeState.dirty
|
||||
? setInterval(() => {
|
||||
saveDraft()
|
||||
}, 2000)
|
||||
}, 1000)
|
||||
: removeDraft()
|
||||
return () => autoSave && clearInterval(autoSave)
|
||||
}, [composeState])
|
||||
|
|
Loading…
Reference in New Issue