]> khamidou — GitHub mirrors - electron.git/commitdiff
:lipstick: for the beforeunload handler.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 07:36:09 +0000 (15:36 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 07:36:09 +0000 (15:36 +0800)
Returning text in beforeunload handler should prevent the close instead
of allow the close.

browser/atom_javascript_dialog_manager.cc

index 83f80a89f57256932265797bbae0bdae86e7f56a..f06a42680b749bac25ff7eff5d27b7acae927f1f 100644 (file)
@@ -13,8 +13,7 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
     const string16& message_text,
     bool is_reload,
     const DialogClosedCallback& callback) {
-
-  bool prevent_reload = message_text.empty() ||
+  bool prevent_reload = !message_text.empty() ||
                         message_text == ASCIIToUTF16("false");
   callback.Run(!prevent_reload, message_text);
 }