bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.77k stars 1.32k forks source link

Add next() call to Promise resolutions #213

Closed ffxsam closed 1 month ago

ffxsam commented 3 years ago

This is a super weird one I encountered while building my app. I noticed when I was logging out and being redirected from /tracks to /login, the Tracks view's created() lifecycle hook was being called as I was leaving the page. After adding the next() calls as in this PR, it fixed the issue.

My only guess is that the next() didn't happen quickly enough and that somehow resulted in the view's created() lifecycle hook being called, though I'm not really clear on why. Adding the next() call worked. And I figured, looking at line 92 (next(...args) before the reject() call), it made sense to call next() before the resolve() calls as well.

bencodezen commented 1 month ago

Appreciate the PR @ffxsam! Sorry fro the delay in getting to this, I let the project lapse and currently in the process of trying to bring everything up to date.

Since this is a PR for the Vue 2 version of the boilerplate, I'm going to close this so we can focus on the Vue 3 boilerplate going forward. Hope all is well!