Skip to content
Closed
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (void)userDefaultsDidChange:(NSNotification *)note
* Set one or more values in the settings.
* TODO: would it be useful to have a callback for when this has completed?
*/
RCT_EXPORT_METHOD(setValues : (NSDictionary *)values)
- (void)setValues:(NSDictionary *)values
{
_ignoringUpdates = YES;
[values enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, BOOL *stop) {
Expand All @@ -98,8 +98,9 @@ - (void)userDefaultsDidChange:(NSNotification *)note
/**
* Remove some values from the settings.
*/
RCT_EXPORT_METHOD(deleteValues : (NSArray<NSString *> *)keys)
- (void)deleteValues:(NSArray *)keysRaw
{
NSArray<NSString *> *keys = [RCTConvert NSStringArray:keysRaw];
_ignoringUpdates = YES;
for (NSString *key in keys) {
[_defaults removeObjectForKey:key];
Expand Down
Loading