Commit f1efac60 authored by Andreas Amsenius's avatar Andreas Amsenius

Don't allocate healthstore more than once

parent 7c59918a
......@@ -270,7 +270,9 @@ RCT_EXPORT_METHOD(authorizationStatusForType:(NSString *)type
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject
{
self.healthStore = [[HKHealthStore alloc] init];
if (self.healthStore == nil) {
self.healthStore = [[HKHealthStore alloc] init];
}
if ([HKHealthStore isHealthDataAvailable]) {
HKObjectType *objectType = [self getWritePermFromString:type];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment