chore: remove prompts events
This commit is contained in:
@@ -77,23 +77,23 @@ export default {
|
||||
this.clip.on('success', () => {
|
||||
this.$showSuccess(this.$t('success.linkCopied'))
|
||||
})
|
||||
this.$root.$on('share-deleted', this.deleted)
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.clip.destroy()
|
||||
this.$root.$off('share-deleted', this.deleted)
|
||||
},
|
||||
methods: {
|
||||
deleteLink: async function (event, link) {
|
||||
event.preventDefault()
|
||||
this.$store.commit('setHash', {
|
||||
hash: link.hash,
|
||||
path: link.path
|
||||
|
||||
this.$store.commit('showHover', {
|
||||
prompt: 'share-delete',
|
||||
confirm: () => {
|
||||
this.$store.commit('closeHovers')
|
||||
|
||||
api.remove(link.hash)
|
||||
this.links = this.links.filter(item => item.hash !== link.hash)
|
||||
}
|
||||
})
|
||||
this.$store.commit('showHover', 'share-delete')
|
||||
},
|
||||
deleted (hash) {
|
||||
this.links = this.links.filter(item => item.hash !== hash)
|
||||
},
|
||||
humanTime (time) {
|
||||
return moment(time * 1000).fromNow()
|
||||
|
||||
Reference in New Issue
Block a user