Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/default-storage/ios/RNCAsyncStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
*
* Keys and values must always be strings or an error is returned.
*/

NS_ASSUME_NONNULL_BEGIN

@interface RNCAsyncStorage : NSObject <
#ifdef RCT_NEW_ARCH_ENABLED
NativeAsyncStorageModuleSpec
Expand Down Expand Up @@ -57,6 +60,8 @@
callback:(RCTResponseSenderBlock)callback;

// Interface for natively fetching all the keys from the storage data.
- (void)getAllKeys:(RCTResponseSenderBlock)callback;
- (void)getAllKeys:(RCTResponseSenderBlock )callback;

@end

NS_ASSUME_NONNULL_END
14 changes: 7 additions & 7 deletions packages/default-storage/ios/RNCAsyncStorage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void RCTStorageDirectoryMigrate(NSString *oldDirectoryPath,
// this folder and attempt folder copying again
if (error != nil && error.code == 4 &&
[newDirectoryPath isEqualToString:RCTGetStorageDirectory()]) {
NSError *error = nil;
error = nil;
_createStorageDirectory(RCTCreateStorageDirectoryPath(@""), &error);
if (error == nil) {
RCTStorageDirectoryMigrate(
Expand Down Expand Up @@ -559,7 +559,7 @@ - (NSDictionary *)_ensureSetup
return nil;
}

- (NSDictionary *)_writeManifest:(NSMutableArray<NSDictionary *> **)errors
- (NSDictionary *)_writeManifest:(NSMutableArray<NSDictionary *> *__autoreleasing *)errors
{
NSError *error;
NSString *serialized = RCTJSONStringify(_manifest, &error);
Expand Down Expand Up @@ -587,7 +587,7 @@ - (NSDictionary *)_appendItemForKey:(NSString *)key
return errorOut;
}

- (NSString *)_getValueForKey:(NSString *)key errorOut:(NSDictionary **)errorOut
- (NSString *)_getValueForKey:(NSString *)key errorOut:(NSDictionary *__autoreleasing *)errorOut
{
NSString *value =
_manifest[key]; // nil means missing, null means there may be a data file, else: NSString
Expand Down Expand Up @@ -699,14 +699,14 @@ - (BOOL)_passthroughDelegate
}
}

NSDictionary *errorOut = [self _ensureSetup];
if (errorOut) {
callback(@[@[errorOut], (id)kCFNull]);
NSDictionary *ensureSetupErrorOut = [self _ensureSetup];
if (ensureSetupErrorOut) {
callback(@[@[ensureSetupErrorOut], (id)kCFNull]);
return;
}
[self _multiGet:keys
callback:callback
getter:^(NSUInteger i, NSString *key, NSDictionary **errorOut) {
getter:^(__unused NSUInteger i, NSString *key, NSDictionary **errorOut) {
return [self _getValueForKey:key errorOut:errorOut];
}];
}
Expand Down