Fix beforeunload dialog

undefined should be returned in beforeunload event callback
no to ask user for confirmation of page reload.

Closes-Bug: #1642949

Change-Id: I99e196376d408d8ac40ac383a0a697a6d14fd3b9
This commit is contained in:
Julia Aranovich 2016-11-23 13:09:34 +03:00
parent 24866201ec
commit c9a2b3186c
1 changed files with 4 additions and 2 deletions

View File

@ -37,8 +37,10 @@ export function dispatcherMixin(events, callback) {
export var unsavedChangesMixin = {
onBeforeunloadEvent() {
return this.hasChanges() &&
(_.result(this, 'getStayMessage') || i18n('dialog.dismiss_settings.default_message'));
return this.hasChanges() ?
_.result(this, 'getStayMessage') || i18n('dialog.dismiss_settings.default_message')
:
undefined;
},
componentWillMount() {
this.eventName = _.uniqueId('unsavedchanges');