Skip to content

Commit

Permalink
Quick bug fix for confirm unload firing on Chrome too often
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed Mar 24, 2016
1 parent 20e7b09 commit fd028a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/gist/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export default Ember.Route.extend({
},

confirmUnload(event) {
if (this.get('controller.unsaved')) {
if (this.get('controller.unsaved') === true) {
if (!window.confirm(CONFIRM_MSG)) {
event.preventDefault();
}
return CONFIRM_MSG; // for Chrome
}
return CONFIRM_MSG; // for Chrome
},

actions: {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/gist-base-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default Ember.Route.extend({
actions: {
willTransition(transition) {
const gistController = this.controllerFor('gist');
if (gistController.get('unsaved')) {
if (gistController.get('unsaved') === true) {
if (!window.confirm(CONFIRM_MSG)) {
transition.abort();
}
Expand Down

0 comments on commit fd028a7

Please sign in to comment.