Permalink
Browse files

Fix bug where disabling custom name won't actually disable it

  • Loading branch information...
1 parent 86fbd4c commit b487796be1c43b432450cdfaed03e0582419905d @kylehickinson committed Nov 12, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 Mac/Reflect/RFReflect.m
View
@@ -312,7 +312,9 @@ - (void)_setup
self.server.delegate = self;
if ([userDefaults[@"server-start-on-launch"] boolValue]) {
- self.server.name = userDefaults[@"bonjour-name"];
+ if ([userDefaults[@"bonjour-use-name"] boolValue]) {
+ self.server.name = userDefaults[@"bonjour-name"];
+ }
[self.server start];
}
@@ -331,7 +333,10 @@ - (void)_toggleServer
} else {
[[self.menu itemAtIndex:2] setTitle:@"Server is starting…"];
[[self.menu itemAtIndex:3] setTitle:@"Stop"];
- self.server.name = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"bonjour-name"];
+ NSUserDefaults *defaults = [[NSUserDefaultsController sharedUserDefaultsController] defaults];
+ if ([defaults boolForKey:@"bonjour-use-name"]) {
+ self.server.name = [defaults objectForKey:@"bonjour-name"];
+ }
[self.server start];
}
}

0 comments on commit b487796

Please sign in to comment.