Browse Source

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

trop[bot] 6 years ago
parent
commit
17b80ebb9c
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

@@ -585,13 +585,13 @@ 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]];
   }
 }