Skip to content

Commit

Permalink
Fix size mapping to react native
Browse files Browse the repository at this point in the history
  • Loading branch information
janwiebe-jump committed Mar 25, 2024
1 parent 4981920 commit e0e645c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/react-native-carplay/ios/RNCarPlay.m
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ - (void)updateListRowItemImageWithURL:(CPListImageRowItem *)item imgUrl:(NSStrin
CPTemplate *template = [store findTemplateById:templateId];
if (template) {
CPListTemplate *listTemplate = (CPListTemplate*) template;
resolve(@(CPListItem.maximumImageSize));
NSDictionary *sizeDict = @{
@"width": @(CPlistItem.maximumImageSize.width),
@"height": @(CPlistItem.maximumImageSize.height)
};
resolve(sizeDict);
} else {
NSLog(@"Failed to find template %@", template);
reject(@"template_not_found", @"Template not found in store", nil);
Expand Down Expand Up @@ -767,7 +771,11 @@ - (void)updateListRowItemImageWithURL:(CPListImageRowItem *)item imgUrl:(NSStrin
CPTemplate *template = [store findTemplateById:templateId];
if (template) {
CPListTemplate *listTemplate = (CPListTemplate*) template;
resolve(@(CPListImageRowItem.maximumImageSize));
NSDictionary *sizeDict = @{
@"width": @(CPListImageRowItem.maximumImageSize.width),
@"height": @(CPListImageRowItem.maximumImageSize.height)
};
resolve(sizeDict);
} else {
NSLog(@"Failed to find template %@", template);
reject(@"template_not_found", @"Template not found in store", nil);
Expand Down

0 comments on commit e0e645c

Please sign in to comment.