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