Skip to content

Commit

Permalink
fix scripts leave bug
Browse files Browse the repository at this point in the history
  • Loading branch information
iwate committed Feb 29, 2020
1 parent 5054c18 commit 15dd4e3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Aiplugs.PoshApp/Views/Shared/Scripts/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@
mounted() {
this.createEditor();
},
async beforeRouteUpdate (to, from, next) {
if (this.content != null) {
if (this.confirmLeave())
next();
} else {
next();
}
async beforeRouteUpdate(to, from, next) {
if (this.content != null && !this.confirmLeave())
return;
next();
await this.changeContent(to.params.repo, to.params.id);
},
beforeRouteLeave (to, from , next) {
Expand Down

0 comments on commit 15dd4e3

Please sign in to comment.