From 78bc8121fff6c8791b6dde1ca9f6164ab69187c9 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Fri, 17 Nov 2017 13:33:04 -0600 Subject: [PATCH] [RN] Fix "Error: Provided an image that is available locally already." --- .../participants/components/Avatar.native.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/react/features/base/participants/components/Avatar.native.js b/react/features/base/participants/components/Avatar.native.js index 42a343ddd..f34cafbe0 100644 --- a/react/features/base/participants/components/Avatar.native.js +++ b/react/features/base/participants/components/Avatar.native.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { View } from 'react-native'; +import { Image, View } from 'react-native'; import { CachedImage, ImageCache } from '../../../mobile/image-cache'; import { Platform } from '../../react'; @@ -263,13 +263,19 @@ export default class Avatar extends Component { imageStyle = style; } - let element = React.createElement(CachedImage, { - ...props, + let element + = React.createElement( - resizeMode: 'contain', - source, - style: imageStyle - }); + // XXX CachedImage removed support for images which clearly do + // not need caching. + typeof source === 'number' ? Image : CachedImage, + { + ...props, + + resizeMode: 'contain', + source, + style: imageStyle + }); if (viewStyle) { element = React.createElement(View, { style: viewStyle }, element);