[ReactNative] Enable resolveAssetSource for Image.android
This commit is contained in:
parent
d094952725
commit
970bff6132
|
@ -32,6 +32,12 @@ describe('resolveAssetSource', () => {
|
|||
expect(resolveAssetSource(source2)).toBe(source2);
|
||||
});
|
||||
|
||||
it('ignores any weird data', () => {
|
||||
expect(resolveAssetSource(null)).toBe(null);
|
||||
expect(resolveAssetSource(42)).toBe(null);
|
||||
expect(resolveAssetSource('nonsense')).toBe(null);
|
||||
});
|
||||
|
||||
describe('bundle was loaded from network', () => {
|
||||
beforeEach(() => {
|
||||
SourceCode.scriptURL = 'http://10.0.0.1:8081/main.bundle';
|
||||
|
|
|
@ -43,10 +43,11 @@ function pickScale(scales, deviceScale) {
|
|||
return scales[scales.length - 1] || 1;
|
||||
}
|
||||
|
||||
// TODO(frantic):
|
||||
// * Pick best scale and append @Nx to file path
|
||||
// * We are currently using httpServerLocation for both http and in-app bundle
|
||||
function resolveAssetSource(source) {
|
||||
if (!source || typeof source !== 'object') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!source.__packager_asset) {
|
||||
return source;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue