Skip to content

Commit fd028a7

Browse files
committed
Quick bug fix for confirm unload firing on Chrome too often
1 parent 20e7b09 commit fd028a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/gist/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export default Ember.Route.extend({
3030
},
3131

3232
confirmUnload(event) {
33-
if (this.get('controller.unsaved')) {
33+
if (this.get('controller.unsaved') === true) {
3434
if (!window.confirm(CONFIRM_MSG)) {
3535
event.preventDefault();
3636
}
37+
return CONFIRM_MSG; // for Chrome
3738
}
38-
return CONFIRM_MSG; // for Chrome
3939
},
4040

4141
actions: {

app/routes/gist-base-route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default Ember.Route.extend({
2222
actions: {
2323
willTransition(transition) {
2424
const gistController = this.controllerFor('gist');
25-
if (gistController.get('unsaved')) {
25+
if (gistController.get('unsaved') === true) {
2626
if (!window.confirm(CONFIRM_MSG)) {
2727
transition.abort();
2828
}

0 commit comments

Comments
 (0)