|
@@ -24,6 +24,7 @@ const RenderMessageImage = ({
|
|
const fileUri = `${CACHED_ATTACHMENTS_DIR}${currentMessage.attachment?.filename}`;
|
|
const fileUri = `${CACHED_ATTACHMENTS_DIR}${currentMessage.attachment?.filename}`;
|
|
|
|
|
|
const [isCached, setIsCached] = useState(false);
|
|
const [isCached, setIsCached] = useState(false);
|
|
|
|
+ const [imageLoading, setImageLoading] = useState(true);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
const checkCache = async () => {
|
|
const checkCache = async () => {
|
|
@@ -84,8 +85,12 @@ const RenderMessageImage = ({
|
|
loadingIndicatorSource={{ uri: currentMessage.image }}
|
|
loadingIndicatorSource={{ uri: currentMessage.image }}
|
|
style={styles.chatImage}
|
|
style={styles.chatImage}
|
|
resizeMode="cover"
|
|
resizeMode="cover"
|
|
|
|
+ onLoadStart={() => setImageLoading(true)}
|
|
|
|
+ onLoad={() => setImageLoading(false)}
|
|
|
|
+ onError={() => setImageLoading(false)}
|
|
/>
|
|
/>
|
|
- {currentMessage.isSending && (
|
|
|
|
|
|
+
|
|
|
|
+ {(currentMessage.isSending || imageLoading) && (
|
|
<View
|
|
<View
|
|
style={{
|
|
style={{
|
|
position: 'absolute',
|
|
position: 'absolute',
|