Created
September 7, 2018 11:31
-
-
Save makirby/6f7a0b6ef2e8865751206b2b69e1abdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patch-package | |
--- a/node_modules/react-native/React/Base/RCTUtils.m | |
+++ b/node_modules/react-native/React/Base/RCTUtils.m | |
@@ -714,7 +714,14 @@ UIImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL) | |
} else { | |
fileData = [NSData dataWithContentsOfURL:imageURL]; | |
} | |
- image = [UIImage imageWithData:fileData]; | |
+ // Fix Codepush | |
+ CGFloat scale = 1.0; | |
+ if ([[imageURL absoluteString] hasSuffix: @"@3x.png"]) { | |
+ scale = 3.0; | |
+ } else if ([[imageURL absoluteString] hasSuffix: @"@2x.png"]) { | |
+ scale = 2.0; | |
+ } | |
+ image = [UIImage imageWithData:fileData scale: scale]; | |
} | |
if (!image && !bundle) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment