Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: manicakes/react-native-icloudstore
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rbruels/react-native-icloudstore
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 1, 2020

  1. Copy the full SHA
    063ab74 View commit details

Commits on Jul 2, 2020

  1. Fix multiget return value

    rbruels committed Jul 2, 2020
    Copy the full SHA
    9701ba7 View commit details
Showing with 6 additions and 5 deletions.
  1. +6 −5 iCloudStorage.m
11 changes: 6 additions & 5 deletions iCloudStorage.m
Original file line number Diff line number Diff line change
@@ -216,18 +216,19 @@ - (void) ubiquitousStoreUpdated:(NSNotification*)notification {
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[keys count]];
for (NSString* key in keys) {
NSObject* object = [iCloudStorage getObjectForKey:key];
if (object != nil) {
[result addObject:object];
if (object == nil) {
object = [NSNull null];
}
[result addObject:@[key, object]];
}

resolve(result);
}

RCT_EXPORT_METHOD(multiSet: (NSDictionary*)keyValuePairs resolver:(RCTPromiseResolveBlock)resolve
RCT_EXPORT_METHOD(multiSet: (NSArray<NSArray<NSString *> *> *)keyValuePairs resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
for (NSString* key in [keyValuePairs allKeys]) {
[iCloudStorage setValue:[keyValuePairs objectForKey:key] forKey:key];
for (NSArray<NSString *> *entry in keyValuePairs) {
[iCloudStorage setValue:entry[1] forKey:entry[0]];
}
resolve(@{});
}