mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
💄 for the beforeunload handler.
Returning text in beforeunload handler should prevent the close instead of allow the close.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user