fix for unsaved changes popup on tab close/refresh

Incorrect return values in onbeforeunload event handler mean that the
unsaved changes popup is shown despite there being no changes.
This commit is contained in:
Daniel Lee 2018-01-09 14:42:42 +01:00
parent 04b9752932
commit 3ea63a1064

View File

@ -35,12 +35,12 @@ export class Tracker {
$window.onbeforeunload = () => {
if (this.ignoreChanges()) {
return '';
return null;
}
if (this.hasChanges()) {
return 'There are unsaved changes to this dashboard';
}
return '';
return null;
};
scope.$on('$locationChangeStart', (event, next) => {