Skip to content

Commit

Permalink
🐛 Fix addLink modal not closing
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Aug 21, 2021
1 parent bc783f2 commit 146ec1b
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions client/components/Modal/AddLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,18 @@ export default {
const crate = this.selectedCrate || this.currentCrate
this.$store.dispatch('ADD_LINK', { url, crate }).then((link) => {
if (!link.meta || !link.meta.title) {
this.$modal.show('linkDetails', { link: link.id })
} else {
this.$modal.hide()
this.$toast.success('Link added!', {
onClick: () => {
if (crate !== undefined && crate !== this.currentCrate) {
this.$switchToPageOrCrate(crate, { link: link.id })
return
}
this.$toast.success('Link added!', {
onClick: () => {
if (crate !== undefined && crate !== this.currentCrate) {
this.$switchToPageOrCrate(crate, { link: link.id })
return
}
this.$modal.show('linkDetails', { link: link.id })
}
})
this.$modal.show('linkDetails', { link: link.id })
}
})
}
this.$modal.hide()
}).catch((err) => {
this.invalidLinkErr = err.message
console.log(err)
Expand Down

0 comments on commit 146ec1b

Please sign in to comment.