Skip to content

Commit

Permalink
Fix a UI-off-main-thread bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsj committed Nov 14, 2024
1 parent e9c0559 commit 4a4f0ce
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Hammerspoon/MJPreferencesWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ - (void) reflectDefaults {
}

- (void)updateFeedbackDisplay:(NSNotification __unused *)notification {
[self.openAtLoginCheckbox setState:MJAutoLaunchGet() ? NSControlStateValueOn : NSControlStateValueOff];
[self.showDockIconCheckbox setState: MJDockIconVisible() ? NSControlStateValueOn : NSControlStateValueOff];
[self.showMenuIconCheckbox setState: MJMenuIconVisible() ? NSControlStateValueOn : NSControlStateValueOff];
[self.keepConsoleOnTopCheckbox setState: MJConsoleWindowAlwaysOnTop() ? NSControlStateValueOn : NSControlStateValueOff];
[self.uploadCrashDataCheckbox setState: HSUploadCrashData() ? NSControlStateValueOn : NSControlStateValueOff];
dispatch_async(dispatch_get_main_queue(), ^{
[self.openAtLoginCheckbox setState:MJAutoLaunchGet() ? NSControlStateValueOn : NSControlStateValueOff];
[self.showDockIconCheckbox setState: MJDockIconVisible() ? NSControlStateValueOn : NSControlStateValueOff];
[self.showMenuIconCheckbox setState: MJMenuIconVisible() ? NSControlStateValueOn : NSControlStateValueOff];
[self.keepConsoleOnTopCheckbox setState: MJConsoleWindowAlwaysOnTop() ? NSControlStateValueOn : NSControlStateValueOff];
[self.uploadCrashDataCheckbox setState: HSUploadCrashData() ? NSControlStateValueOn : NSControlStateValueOff];
#ifndef SENTRY_API_URL
[self.uploadCrashDataCheckbox setState:NSControlStateValueOff];
[self.uploadCrashDataCheckbox setEnabled:NO];
[self.uploadCrashDataCheckbox setState:NSControlStateValueOff];
[self.uploadCrashDataCheckbox setEnabled:NO];
#endif

});
}

- (void) showWindow:(id)sender {
Expand Down

0 comments on commit 4a4f0ce

Please sign in to comment.