From 914aafc759987988b69ce9ff82cf1f9b34af7ef9 Mon Sep 17 00:00:00 2001 From: xerdnu Date: Fri, 16 Aug 2024 21:40:19 +0200 Subject: [PATCH] Patch v1.0.2 --- CHANGELOG.md | 6 ++++++ ios/BlastedViewManager.m | 12 ++++++++---- package.json | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3edab76..beece54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.0.2] (2024-08-16) + +#### Bug Fixes + +- Fixed a bug where images was not sent into view on iOS. + ## [1.0.1] (2024-08-16) #### Improvements diff --git a/ios/BlastedViewManager.m b/ios/BlastedViewManager.m index 23c762a..8788f0c 100644 --- a/ios/BlastedViewManager.m +++ b/ios/BlastedViewManager.m @@ -2,6 +2,8 @@ #import "BlastedImageModule.h" #import #import +#import +#import #import @implementation BlastedViewManager @@ -17,9 +19,12 @@ - (BOOL)isEmptyString:(NSString *)str { return (!str || ![str isKindOfClass:[NSString class]] || [str isEqualToString:@""]); } -RCT_CUSTOM_VIEW_PROPERTY(source, NSString, UIImageView) { +RCT_CUSTOM_VIEW_PROPERTY(source, NSDictionary, UIImageView) { - if ([self isEmptyString:json]) { + BlastedImageModule *blastedImageModule = [self.bridge moduleForClass:[BlastedImageModule class]]; + + if ([self isEmptyString:json[@"uri"]]) { + [blastedImageModule sendEventWithName:@"BlastedEventLog" message:@"Source is empty"]; [view setHidden:YES]; return; } @@ -28,9 +33,8 @@ - (BOOL)isEmptyString:(NSString *)str { BOOL hybridAssets = [RCTConvert BOOL:json[@"hybridAssets"]]; NSString *cloudUrl = [RCTConvert NSString:json[@"cloudUrl"]]; - BlastedImageModule *blastedImageModule = [[BlastedImageModule alloc] init]; NSURL *url = [blastedImageModule prepareUrl:uri hybridAssets:hybridAssets cloudUrl:cloudUrl showLog:NO]; - + if (url != nil && ![url.absoluteString isEqualToString:@""]) { [view sd_setImageWithURL:url]; [view setHidden:NO]; diff --git a/package.json b/package.json index b6f0d57..ed2039f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-blasted-image", - "version": "1.0.1", + "version": "1.0.2", "description": "A simple yet powerful image component for React Native, powered by Glide and SDWebImage", "main": "index.js", "types": "index.d.ts",