Skip to content

Commit

Permalink
Fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Timac committed Oct 2, 2024
1 parent ba3ccf8 commit 87f7335
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions Common/ACNEServicesManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,39 @@ + (ACNEServicesManager *)sharedNEServicesManager
{
sSharedNEServicesManager = [[ACNEServicesManager alloc] init];
}

return sSharedNEServicesManager;
}

- (instancetype)init
{
self = [super init];
if (self)
{
// Create the dispatch queue
_neServiceQueue = dispatch_queue_create("Network Extension service Queue", NULL);
// Allocate the NEServices array
_neServices = [[NSMutableArray alloc] init];
}
return self;
self = [super init];
if (self)
{
// Create the dispatch queue
_neServiceQueue = dispatch_queue_create("Network Extension service Queue", NULL);

// Allocate the NEServices array
_neServices = [[NSMutableArray alloc] init];
}
return self;
}

-(void) loadConfigurationsWithHandler:(void (^)(NSError * error))handler
{
// Load the NEConfigurations
[[NEConfigurationManager sharedManager] loadConfigurationsWithCompletionQueue:[self neServiceQueue] handler:^(NSArray<NEConfiguration *> * neConfigurations, NSError * error)
{
[[NEConfigurationManager sharedManager] loadConfigurationsWithCompletionQueue:[self neServiceQueue] handler:^(NSArray<NEConfiguration *> * neConfigurations, NSError * error)
{
if(error != nil)
{
NSLog(@"ERROR loading configurations - %@", error);
return;
}

dispatch_async(dispatch_get_main_queue(), ^
{

dispatch_async(dispatch_get_main_queue(), ^{
// Process the configurations
[self processConfigurations:neConfigurations];

handler(error);
});
}];
Expand All @@ -66,29 +65,29 @@ - (void)processConfigurations:(NSArray <NEConfiguration*>*)inConfigurations
[self.neServices removeAllObjects];

NSArray<NSString *>* ignoredVPNs = [[ACPreferences sharedPreferences] ignoredVPNs];

for(NEConfiguration *neConfiguration in inConfigurations)
{
if([ignoredVPNs containsObject:neConfiguration.name])
{
// Don't show the VPNs that should be ignored
continue;
}

ACNEService *service = [[ACNEService alloc] initWithConfiguration:neConfiguration];
[self.neServices addObject:service];
}

// Sort by name
[self.neServices sortUsingComparator:^NSComparisonResult(ACNEService *obj1, ACNEService *obj2)
{
return [obj1.name compare:obj2.name];
}];

// Refresh the states
for(ACNEService *neService in self.neServices)
{
[neService refreshSession];
[neService refreshSession];
}
}

Expand Down

0 comments on commit 87f7335

Please sign in to comment.