瀏覽代碼

[RN] Fix "Error: Provided an image that is available locally already."

master
Lyubo Marinov 8 年之前
父節點
當前提交
78bc8121ff
共有 1 個文件被更改,包括 13 次插入7 次删除
  1. 13
    7
      react/features/base/participants/components/Avatar.native.js

+ 13
- 7
react/features/base/participants/components/Avatar.native.js 查看文件

@@ -1,6 +1,6 @@
1 1
 import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3
-import { View } from 'react-native';
3
+import { Image, View } from 'react-native';
4 4
 
5 5
 import { CachedImage, ImageCache } from '../../../mobile/image-cache';
6 6
 import { Platform } from '../../react';
@@ -263,13 +263,19 @@ export default class Avatar extends Component {
263 263
             imageStyle = style;
264 264
         }
265 265
 
266
-        let element = React.createElement(CachedImage, {
267
-            ...props,
266
+        let element
267
+            = React.createElement(
268 268
 
269
-            resizeMode: 'contain',
270
-            source,
271
-            style: imageStyle
272
-        });
269
+                // XXX CachedImage removed support for images which clearly do
270
+                // not need caching.
271
+                typeof source === 'number' ? Image : CachedImage,
272
+                {
273
+                    ...props,
274
+
275
+                    resizeMode: 'contain',
276
+                    source,
277
+                    style: imageStyle
278
+                });
273 279
 
274 280
         if (viewStyle) {
275 281
             element = React.createElement(View, { style: viewStyle }, element);

Loading…
取消
儲存