Avoid errors on Audio/Image/Video (#443)
This commit is contained in:
parent
849de55604
commit
4c19de9433
|
@ -97,6 +97,11 @@ export default class Audio extends React.PureComponent {
|
|||
user, baseUrl, customEmojis, file
|
||||
} = this.props;
|
||||
const { description } = file;
|
||||
|
||||
if (!baseUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
[
|
||||
<View key='audio' style={styles.audioContainer}>
|
||||
|
|
|
@ -38,6 +38,11 @@ export default class extends React.PureComponent {
|
|||
render() {
|
||||
const { baseUrl, file, user } = this.props;
|
||||
const img = `${ baseUrl }${ file.image_url }?rc_uid=${ user.id }&rc_token=${ user.token }`;
|
||||
|
||||
if (!baseUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
[
|
||||
<TouchableOpacity
|
||||
|
|
|
@ -60,9 +60,6 @@ const Url = ({ url, index }) => {
|
|||
return (
|
||||
<Touch onPress={() => onPress(url.url)} style={[styles.button, index > 0 && styles.marginTop]}>
|
||||
<View style={styles.container}>
|
||||
{/* <View style={{ backgroundColor: 'red', height: 150, borderTopLeftRadius: 5, borderTopRightRadius: 5 }}>
|
||||
{url.image ? <FastImage source={{ uri: url.image }} /> : null}
|
||||
</View> */}
|
||||
{url.image ? <FastImage source={{ uri: url.image }} style={styles.image} resizeMode={FastImage.resizeMode.cover} /> : null}
|
||||
<View style={styles.textContainer}>
|
||||
<Text style={styles.url} numberOfLines={1}>{url.url}</Text>
|
||||
|
|
|
@ -62,6 +62,11 @@ export default class Video extends React.PureComponent {
|
|||
const { isVisible } = this.state;
|
||||
const { description } = this.props.file;
|
||||
const { baseUrl, user, customEmojis } = this.props;
|
||||
|
||||
if (!baseUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
[
|
||||
<View key='button'>
|
||||
|
|
Loading…
Reference in New Issue