jasonmit / ember-onbeforeunload

invoke logic when transitioning between routes or closing window
MIT License
30 stars 6 forks source link

checks for dirty page when shouldCheckIsPageDirty returns false #21

Open r00b opened 5 years ago

r00b commented 5 years ago

The ember-onbeforeunload mixin will ONLY check for the dirty page attribute via isPageDirty when shouldCheckIsPageDirty returns false. This seems completely counter-intuitive. Why would we not check for a dirty page when shouldCheckIsPageDirty returns true?

The logic that does this is here. This constantly confuses me and my team because it seems completely backwards.

I am happy to open a PR fixing this @blimmer, would that be okay? Though, this could break any applications currently using this addon if their addon manager specification is general enough to catch the version.