Skip to content

Commit

Permalink
🐛 Fix moving links between crates and add success notification
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Sep 4, 2021
1 parent 3c875df commit 5de5423
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions client/components/SideBar/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,23 @@ export default {
if (endpoint) {
const link = await this.$api.getExternalLink(linkId, endpoint)
const newLink = await this.$api.addLinkToCrate(link.meta && link.meta.title, link.url, this.crateId)
await this.$api.addLinkToCrate(link.url, this.crateId)
this.$toast.success('Copied external link!', {
onClick: () => {
this.$switchToPageOrCrate(this.crateId, { link: newLink.id })
}
})
// this.$modal.show('linkDetails', { link: newLink.id })
/* this.$store.commit('SET_CURRENT_CRATE', this.crateId)
this.$router.push(`/crate/${ this.crateId }`)
*/
return
}
this.$store.dispatch('MOVE_LINK', { linkId, crate: this.crateId })
this.$toast.success('Link moved!', {
onClick: () => {
this.$switchToPageOrCrate(this.crateId, { link: linkId })
}
})
}
}
}
Expand Down

0 comments on commit 5de5423

Please sign in to comment.