Browse Source

fix: correct reversed logic in NativeWindowMac::SetEnabled (#15322)

Backport of #15257
Michelle Tilley 6 years ago
parent
commit
a03da04578
1 changed files with 2 additions and 2 deletions
  1. 2 2
      atom/browser/native_window_mac.mm

+ 2 - 2
atom/browser/native_window_mac.mm

@@ -1155,12 +1155,12 @@ bool NativeWindowMac::IsEnabled() {
 
 void NativeWindowMac::SetEnabled(bool enable) {
   if (enable) {
+    [window_ endSheet: [window_ attachedSheet]];
+  } else {
     [window_ beginSheet: window_ completionHandler:^(NSModalResponse returnCode) {
        NSLog(@"modal enabled");
        return;
     }];
-  } else {
-    [window_ endSheet: [window_ attachedSheet]];
   }
 }